* A key for storing the current selection within the currently active
* project for copy/paste implementation.
*/
- private static final Key KEY_DIAGRAM_SELECTION = DiagramSelectionRepresentation.KEY_DIAGRAM_SELECTION;
+ private static final Key KEY_DIAGRAM_SELECTION = DiagramSelectionRepresentation.KEY_DIAGRAM_SELECTION;
private static final boolean DEBUG = false;
private static final boolean DEBUG_SELECTION_UPDATE = false;
public static final int COPY_GHOSTING_PAINT_PRIORITY = 600;
- private static final int HIGHLIGHT_PAINT_PRIORITY = 500;
+ protected static final int HIGHLIGHT_PAINT_PRIORITY = 500;
@Dependency
- private Selection sel;
+ protected Selection sel;
@Dependency
- private MouseUtil mouseUtil;
+ protected MouseUtil mouseUtil;
protected final IStatusLineManager statusLine;
protected final CopyPasteStrategy strategy;
*/
protected boolean hasFocus = false;
- private AbstractCanvasParticipant highlightMode = null;
+ protected AbstractCanvasParticipant highlightMode = null;
private IProject observedProject = null;
/**
return DiagramSelection.EMPTY;
}
- private DiagramSelection getProjectSelection() {
+ protected DiagramSelection getProjectSelection() {
IProject p = peekProject();
if (p == null)
return DiagramSelection.EMPTY;
return ds != null ? ds : DiagramSelection.EMPTY;
}
- void setDiagramSelection(DiagramSelection selection) {
+ protected void setDiagramSelection(DiagramSelection selection) {
setProjectSelection(selection);
strategy.copyToClipboard(selection);
}
- void setProjectSelection(DiagramSelection selection) {
+ protected void setProjectSelection(DiagramSelection selection) {
assert selection != null;
IProject p = getProject();
if (p == null)
p.setHint(KEY_DIAGRAM_SELECTION, selection);
}
- private void removeProjectSelection() {
+ protected void removeProjectSelection() {
setProjectSelection(DiagramSelection.EMPTY);
removeHighlight();
clearSG();
return false;
}
- boolean initiateCopy(boolean cut) {
+ protected boolean initiateCopy(boolean cut) {
//System.out.println("INITIATING COPY");
int selectionId = 0;
message(null);
return false;
}
-
+
TimeLogger.resetTimeAndLog(getClass(), "paste");
ElementObjectAssortment ea = ds.getAssortment();
}
}
- private String fixAssortment(ElementAssortment ea, boolean cut) {
+ protected String fixAssortment(ElementAssortment ea, boolean cut) {
Topology diagramTopology = diagram.getDiagramClass().getAtMostOneItemOfClass(Topology.class);
List<Connection> conns = new ArrayList<Connection>();
* @param ea
* @return
*/
- private void pruneAssortment(ElementAssortment ea, boolean cut) {
+ protected void pruneAssortment(ElementAssortment ea, boolean cut) {
// Edges and branch points are never copied as such.
// They are always included as parts of copied connections.
// Edges can never be transformed or modified in any way as such,
* @param e
* @return
*/
- private static boolean isConnectionOrEdge(IElement e) {
+ protected static boolean isConnectionOrEdge(IElement e) {
ElementClass ec = e.getElementClass();
return ec.containsClass(ConnectionHandler.class)|| ec.containsClass(BendsHandler.class);
}
* @param e
* @return
*/
- private static boolean isMoveable(IElement e) {
+ protected static boolean isMoveable(IElement e) {
ElementClass ec = e.getElementClass();
return ec.containsClass(Move.class) && ec.containsClass(Transform.class);
}
* @return <code>null</code> if a point of reference cannot be determined
* for the specified selection.
*/
- private Point2D getCopyStartPos(Set<IElement> ss) {
+ protected Point2D getCopyStartPos(Set<IElement> ss) {
// MouseInfo mi = mouseUtil.getMouseInfo(0);
// if (mi != null) {
// return (Point2D) mi.canvasPosition.clone();
return ghostNode.addNode(id, clazz);
}
- private boolean hasHighlight() {
+ protected boolean hasHighlight() {
return highlightMode != null;
}
- private void removeHighlight() {
+ protected void removeHighlight() {
if (isRemoved())
return;
assert getContext().getThreadAccess().currentThreadAccess();
return (e.stateMask & MouseEvent.CTRL_MASK) != 0;
}
- void selectedMessage(DiagramSelection ds) {
+ protected void selectedMessage(DiagramSelection ds) {
int size = ds.getOriginalElements().size();
StringBuilder sb = new StringBuilder();
if (size == 0) {
message(sb.toString());
}
- void message(final String message) {
+ protected void message(final String message) {
if (statusLine == null)
return;
swtExec(new Runnable() {
});
}
- void error(final String message) {
+ protected void error(final String message) {
if (statusLine == null)
return;
swtExec(new Runnable() {
});
}
- void swtExec(Runnable r) {
+ protected void swtExec(Runnable r) {
ThreadUtils.asyncExec(SWTThread.getThreadAccess(Display.getDefault()), r);
}
graph.claim(resource, L0X.ObtainsProperty1, null, template);
}
}
-
+
}
});
}