Search in sources :

Example 26 with MathObject

use of doc.mathobjects.MathObject in project OpenNotebook by jaltekruse.

the class NotebookPanel method sendBackward.

public void sendBackward() {
    MathObject mObj = getCurrentDocViewer().getFocusedObject();
    if (mObj != null) {
        mObj.getParentPage().sendObjectBackward(mObj);
        getCurrentDocViewer().addUndoState();
        getCurrentDocViewer().repaint();
    }
}
Also used : MathObject(doc.mathobjects.MathObject)

Example 27 with MathObject

use of doc.mathobjects.MathObject in project OpenNotebook by jaltekruse.

the class NotebookPanel method sendForward.

public void sendForward() {
    MathObject mObj = getCurrentDocViewer().getFocusedObject();
    if (mObj != null) {
        mObj.getParentPage().sendObjectForward(mObj);
        getCurrentDocViewer().addUndoState();
        getCurrentDocViewer().repaint();
    }
}
Also used : MathObject(doc.mathobjects.MathObject)

Example 28 with MathObject

use of doc.mathobjects.MathObject in project OpenNotebook by jaltekruse.

the class NotebookPanel method createPopupBelowCurrObject.

private String createPopupBelowCurrObject(String message, String defaultInput) {
    MathObject currFocused = this.getCurrentDocViewer().getFocusedObject();
    PointInDocument ptInDoc = new PointInDocument(// TODO - HAX - fix this
    this.getCurrentDocViewer().getDoc().getPageIndex(currFocused.getParentPage()), currFocused.getxPos(), currFocused.getyPos() + currFocused.getHeight());
    JOptionPane optionPane = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, null, defaultInput);
    optionPane.setWantsInput(true);
    optionPane.setInitialSelectionValue(defaultInput);
    JDialog dialog = optionPane.createDialog(this, "");
    Point p = getCurrentDocViewer().docPt2AbsoluteScreenPos(ptInDoc);
    optionPane.selectInitialValue();
    dialog.setBounds((int) p.getX(), (int) p.getY() + 15, 250, 200);
    dialog.setVisible(true);
    dialog.dispose();
    String result = (String) optionPane.getInputValue();
    return result.equals("uninitializedValue") ? null : result;
}
Also used : MathObject(doc.mathobjects.MathObject)

Example 29 with MathObject

use of doc.mathobjects.MathObject in project OpenNotebook by jaltekruse.

the class NotebookPanel method bringToFront.

public void bringToFront() {
    MathObject mObj = getCurrentDocViewer().getFocusedObject();
    if (mObj != null) {
        mObj.getParentPage().bringObjectToFront(mObj);
        getCurrentDocViewer().addUndoState();
        getCurrentDocViewer().repaint();
    }
}
Also used : MathObject(doc.mathobjects.MathObject)

Example 30 with MathObject

use of doc.mathobjects.MathObject in project OpenNotebook by jaltekruse.

the class NotebookPanel method cut.

public void cut() {
    MathObject mObj = getCurrentDocViewer().getFocusedObject();
    if (mObj != null) {
        // application specific clipboard
        setClipBoardContents(mObj.clone());
        addToSystemClipboard(mObj);
        mObj.getParentContainer().removeObject(mObj);
        getCurrentDocViewer().setFocusedObject(null);
        if (mObj == getCurrentDocViewer().getTempGroup()) {
            getCurrentDocViewer().removeTempGroup();
        }
        getCurrentDocViewer().addUndoState();
        getCurrentDocViewer().repaint();
    }
}
Also used : MathObject(doc.mathobjects.MathObject)

Aggregations

MathObject (doc.mathobjects.MathObject)31 Grouping (doc.mathobjects.Grouping)6 PointInDocument (doc.PointInDocument)4 Point (java.awt.Point)4 AttributeException (doc.attributes.AttributeException)3 Page (doc.Page)2 GeneratedProblem (doc.mathobjects.GeneratedProblem)2 ProblemGenerator (doc.mathobjects.ProblemGenerator)2 ProblemNumberObject (doc.mathobjects.ProblemNumberObject)2 TextObject (doc.mathobjects.TextObject)2 Rectangle (java.awt.Rectangle)2 MathObjectAttribute (doc.attributes.MathObjectAttribute)1 RectangleObject (doc.mathobjects.RectangleObject)1 VariableValueInsertionProblem (doc.mathobjects.VariableValueInsertionProblem)1 BasicStroke (java.awt.BasicStroke)1 Color (java.awt.Color)1 Component (java.awt.Component)1 Graphics2D (java.awt.Graphics2D)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1