Search in sources :

Example 31 with MathObject

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

the class NotebookPanel method ungroup.

public void ungroup() {
    MathObject mObj = getCurrentDocViewer().getFocusedObject();
    if (mObj != null) {
        if (mObj instanceof Grouping) {
            if (mObj == getCurrentDocViewer().getTempGroup()) {
                getCurrentDocViewer().ungroupTempGroup();
            } else {
                ((Grouping) mObj).unGroup();
                mObj.getParentContainer().removeObject(mObj);
            }
            getCurrentDocViewer().setFocusedObject(null);
            getCurrentDocViewer().addUndoState();
            getCurrentDocViewer().repaint();
        }
    }
}
Also used : Grouping(doc.mathobjects.Grouping) 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