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();
}
}
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();
}
}
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;
}
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();
}
}
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();
}
}
Aggregations