/** Change the color of a tag in this plugin's internal model */ public void localSetIntentionTypeColor(long typeId, int colorIndex) { activeIntentionTypes.get(typeId).setColorIndex(colorIndex); if (CanvasPerspective.getInstance().isActive()) { CanvasTagPanel.getInstance().refresh(); } }
public void toggleTagPanelVisibility() { if (!tagPanelVisible) { if (CIntentionCellController.getInstance().getCellByCanvasId(currentCanvasId) == null) { return; // not showing the tag panel if there is no CIC for the current canvas } } tagPanelVisible = !tagPanelVisible; CanvasTagPanel.getInstance().setVisible(tagPanelVisible); }
/** * Notify this controller that the Canvas View is now showing <code>canvasId</code>. Updates all * visual components accordingly. */ public void canvasChanged(long canvasId) { currentCanvasId = canvasId; CanvasTitlePanel.getInstance().moveTo(canvasId); CanvasTagPanel.getInstance().moveTo(canvasId); CCanvasLinkController.getInstance().showingCanvas(canvasId); CIntentionCell cell = CIntentionCellController.getInstance().getCellByCanvasId(canvasId); if (cell == null) { showTagPanel(false); } else { showTagPanel(!cell.hasIntentionType()); } if ((canvasCreationContext != null) && (canvasId != canvasCreationContext.newCanvasId)) { canvasCreationContext = null; } }
private void initializeComponents() { CanvasTitlePanel.getInstance().setLayout(titlePanelBounds); CanvasTagPanel.getInstance().setLayout(tagPanelBounds); }
/** Remove a tag from this plugin's internal model */ public void localRemoveIntentionType(long typeId) { activeIntentionTypes.remove(typeId); CanvasTagPanel.getInstance().updateIntentionTypes(); }
/** Rename a tag in this plugin's internal model */ public void localRenameIntentionType(long typeId, String name) { activeIntentionTypes.get(typeId).setName(name); CanvasTagPanel.getInstance().updateIntentionTypes(); }
/** Add a new tag to this plugin's internal model */ public void localAddIntentionType(CIntentionType type) { activeIntentionTypes.put(type.getId(), type); CanvasTagPanel.getInstance().updateIntentionTypes(); }