22#include <QGraphicsScene>
44 const QSize &viewSize)
const
64 bool atLeastOneSelectedItem)
67 <<
" key=" << QKeySequence (key).toString ().toLatin1 ().data ();
69 if (atLeastOneSelectedItem) {
71 if (key == Qt::Key_Down ||
73 key == Qt::Key_Left ||
74 key == Qt::Key_Right) {
76 keyPressArrow (cmdMediator,
83void DigitizeStateAbstractBase::keyPressArrow (
CmdMediator *cmdMediator,
90 deltaScreen = QPointF (0, zoomedToUnzoomedScreenY ());
95 deltaScreen = QPointF (-1 * zoomedToUnzoomedScreenX (), 0);
100 deltaScreen = QPointF (zoomedToUnzoomedScreenX (), 0);
105 deltaScreen = QPointF (0, -1 * zoomedToUnzoomedScreenY ());
114 GraphicsItemsExtractor graphicsItemsExtractor;
116 CmdMoveBy *cmd =
new CmdMoveBy (
context().mainWindow(),
150 m_context.view ().setCursor (
cursor (cmdMediator));
153double DigitizeStateAbstractBase::zoomedToUnzoomedScreenX ()
const
159double DigitizeStateAbstractBase::zoomedToUnzoomedScreenY ()
const
const QString MOVE_TEXT_UP(QObject::tr("Move up"))
const QString MOVE_TEXT_DOWN(QObject::tr("Move down"))
const QString MOVE_TEXT_LEFT(QObject::tr("Move left"))
const QString MOVE_TEXT_RIGHT(QObject::tr("Move right"))
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
log4cpp::Category * mainCat
QString moveTextUp() const
Display text for up arrow.
QString moveTextDown() const
Display text for down arrow.
QString moveTextLeft() const
Display text for left arrow.
virtual ~DigitizeStateAbstractBase()
virtual void handleKeyPressArrow(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
If the key is an arrow (left, right, up, down) then move currently selected items.
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
QString moveTextRight() const
Display text for right arrow.
virtual QCursor cursor(CmdMediator *cmdMediator) const =0
Returns the state-specific cursor shape.
bool canPasteProtected(const Transformation &transformation, const QSize &viewSize) const
Protected version of canPaste method. Some, but not all, leaf classes use this method.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
GraphicsScene & scene()
Scene container for the QImage and QGraphicsItems.
GraphicsView & view()
View for the QImage and QGraphicsItems, without const.
Detect if text is acceptable for ingestion by MimePoints.
bool isMimePointsData(const Transformation &transforation, const QSize &screenSize) const
Returns true if text is acceptable mime data.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)