this.tooltips = tooltips; this.dockableUID = uid == null ? UUID.randomUUID().toString() : uid; this.dockable = new DefaultSingleCDockable(dockableUID, icon, pluginName); this.dockable.setTitleText(pluginName); this.dockable.setTitleToolTip(tooltips); this.dockable.setTitleIcon(icon); this.dockable.setFocusComponent(this); this.dockable.setStackable(true); this.dockable.setSingleTabShown(true); this.dockable.putAction(CDockable.ACTION_KEY_CLOSE, new CCloseAction(UIManager.DOCKING_CONTROL) { @Override public void close(CDockable dockable) { this.dockable.setCloseable(true); this.dockable.setMinimizable(false); this.dockable.setExternalizable(false); this.dockable.addAction(new CloseOthersAction(dockable, false)); this.dockable.addAction(new CloseOthersAction(dockable, true));
@Override public void setDockable(Object dock) { this.dockable = (DefaultSingleCDockable) dock; this.visible = dockable.isVisible(); dockable.addCDockableStateListener(stateListener); dockable.addFocusListener(focusListener); if (extendedMode != null) { dockable.setExtendedMode(extendedMode); } }
public PluginTool(String id, String toolName, POSITION defaultPosition, ExtendedMode defaultMode, Type type, int position) { // Works only if there is only one instance of pluginTool at the same time this.dockableWidth = -1; this.type = type; this.toolPosition = position; this.defaultPosition = defaultPosition; this.defaultMode = defaultMode; this.dockable = new DefaultSingleCDockable(id, null, toolName); this.dockable.setTitleText(toolName); this.dockable.setExternalizable(false); this.dockable.setMaximizable(false); this.dockable.addCDockableLocationListener(event -> { if (event.isLocationChanged()) { changeToolWindowAnchor(event.getNewLocation()); } }); }
setTitleIconHandling( iconHandling ); setTitleIcon( icon ); setTitleText( title ); getContentPane().setLayout( new BorderLayout() ); getContentPane().add( content, BorderLayout.CENTER ); addAction( action ); else addSeparator();
public MeasureTool(ImageViewerEventManager<? extends ImageElement> eventManager) { super(BUTTON_NAME, BUTTON_NAME, PluginTool.Type.TOOL, 30); this.eventManager = eventManager; this.rootPane = new JScrollPane(); dockable.setTitleIcon(new ImageIcon(MeasureTool.class.getResource("/icon/16x16/measure.png"))); //$NON-NLS-1$ setDockableWidth(javax.swing.UIManager.getLookAndFeel() != null ? javax.swing.UIManager.getLookAndFeel().getClass().getName().startsWith("org.pushingpixels") ? 190 : 205 //$NON-NLS-1$ : 205); jbInit(); }
private DefaultSingleCDockable createSingleDock(DockWindow dock) { String title = dock.getTitle(); Component component = dock.getComponent(); String id = dock.getId(); DefaultSingleCDockable dockable = new DefaultSingleCDockable(id, title, component); dockable.setCloseable(dock.isCloseable()); dockable.setExternalizable(dock.isExternalizable()); dockable.setMaximizable(dock.isMaximizable()); dockable.setMinimizable(dock.isMinimizable()); dockable.setStackable(dock.isStackable()); return dockable; }
private void updateVisibleState() { if (!dockable.isVisible()) { UIManager.DOCKING_CONTROL.addVetoFocusListener(UIManager.DOCKING_VETO_FOCUS); Component component = getToolComponent(); JMVUtils.setPreferredWidth(component, getDockableWidth()); if (dockable.getFocusComponent() == component) { UIManager.DOCKING_CONTROL.addDockable(dockable); dockable.setExtendedMode(defaultMode == null ? ExtendedMode.MINIMIZED : defaultMode); } else { dockable.add(component); dockable.setFocusComponent(component); dockable.setDefaultLocation(ExtendedMode.MINIMIZED, minimizeLocation); pos == POSITION.EAST ? base.normalEast(ratio) : pos == POSITION.WEST ? base.normalWest(ratio) : pos == POSITION.NORTH ? base.normalNorth(ratio) : base.normalSouth(ratio); dockable.setDefaultLocation(ExtendedMode.NORMALIZED, normalizedLocation); dockable.setMinimizedSize(new Dimension(dockableWidth, 50)); dockable.setExtendedMode(mode); dockable.setVisible(true); dockable.setResizeLocked(true); UIManager.DOCKING_CONTROL.removeVetoFocusListener(UIManager.DOCKING_VETO_FOCUS);
GraphicsDevice[] gd = ge.getScreenDevices(); if (gd.length > 1) { viewer.getDockable().setExternalizable(true); setExternalPosition(viewer.getDockable()); title = group.toString(); viewer.setGroupID(group); viewer.getDockable().setTitleToolTip(title); viewer.setPluginName(StringUtil.getTruncatedString(title, 25, Suffix.THREE_PTS)); viewer.getDockable().setTitleIcon((Icon) val);
for (int i = UIManager.VIEWER_PLUGINS.size() - 1; i >= 0; i--) { ViewerPlugin p = UIManager.VIEWER_PLUGINS.get(i); if (p.getDockable().isExternalizable()) { Dialog dialog = WinUtil.getParentDialog(p); if (dialog != null && screenBound.equals(WinUtil.getClosedScreenBound(dialog.getBounds()))) { dock.setExternalizable(true); dock.setLocation(CLocation.external(screenBound.x, screenBound.y, screenBound.width - 150, screenBound.height - 150)); plugin.showDockable(); GuiExecutor.instance().execute(() -> { if (dock.isVisible()) { UIManager.DOCKING_CONTROL.addVetoFocusListener(UIManager.DOCKING_VETO_FOCUS); dock.setExtendedMode(ExtendedMode.MAXIMIZED); UIManager.DOCKING_CONTROL.removeVetoFocusListener(UIManager.DOCKING_VETO_FOCUS); Rectangle b2 = parent.getBounds(); b2.setLocation(parent.getLocationOnScreen()); dock.setLocation(CLocation.external(b2.x, b2.y, b2.width, b2.height).stack()); plugin.showDockable();
public void showDockable() { GuiExecutor.instance().execute(() -> { if (!dockable.isVisible()) { if (!UIManager.VIEWER_PLUGINS.contains(ViewerPlugin.this)) { UIManager.VIEWER_PLUGINS.add(ViewerPlugin.this); } dockable.add(getComponent()); dockable.setFocusComponent(ViewerPlugin.this); UIManager.MAIN_AREA.add(getDockable()); dockable.setDefaultLocation(ExtendedMode.NORMALIZED, CLocation.working(UIManager.MAIN_AREA).stack()); dockable.setVisible(true); } }); }
public void setPluginName(String pluginName) { this.pluginName = pluginName; this.dockable.setTitleText(pluginName); }
public DicomExplorer(DicomModel model) { super(BUTTON_NAME, NAME, POSITION.WEST, ExtendedMode.NORMALIZED, PluginTool.Type.EXPLORER, 20); setLayout(new BorderLayout()); setDockableWidth(180); dockable.setMaximizable(true); this.model = model == null ? new DicomModel() : model; this.selectionList = new SeriesSelectionModel(patientContainer); thumnailView.getVerticalScrollBar().setUnitIncrement(16); thumnailView.setViewportView(patientContainer); changeToolWindowAnchor(getDockable().getBaseLocation()); }
/** * Creates a SingleCDockable object. * * @param title the title * @param panel the panel * @return the SingleCDockable */ private static SingleCDockable create(String title, JPanel panel) { return new DefaultSingleCDockable(title, title, panel); }
@Override public void visibilityChanged(CDockable d) { updateVisible(dockable.isVisible()); }
public void setExtendedMode(ExtendedMode extendedMode) { this.extendedMode = extendedMode; DefaultSingleCDockable dock = getDockable(); if (dock != null) { dock.setExtendedMode(extendedMode); } }
public void initImageGroupPane() { centralPane.getDockable().setCloseable(false); centralPane.showDockable(); centralPane.setSelectedAndGetFocus(); }
setTitleIconHandling( iconHandling ); setTitleIcon( icon ); setTitleText( title ); getContentPane().setLayout( new BorderLayout() ); getContentPane().add( content, BorderLayout.CENTER ); addAction( action ); else addSeparator();
public ImageTool(String pluginName) { super(BUTTON_NAME, pluginName, PluginTool.Type.TOOL, 20); dockable.setTitleIcon(new ImageIcon(ImageTool.class.getResource("/icon/16x16/image.png"))); //$NON-NLS-1$ setDockableWidth(290); jbInit(); }
@OnAwt public void setTitle(String title) { this.title = title; if (this.dockable != null) { dockable.setTitleText(title); } }
public MeasureAnnotationTool() { super(BUTTON_NAME, BUTTON_NAME, POSITION.EAST, ExtendedMode.NORMALIZED, PluginTool.Type.TOOL, 30); this.rootPane = new JScrollPane(); dockable.setTitleIcon(new ImageIcon(MeasureTool.class.getResource("/icon/16x16/measure.png"))); //$NON-NLS-1$ setDockableWidth(300); jbInit(); }