private void markChanged() { if (!documentChanged && loaded) { documentChanged = true; updateTitle(); getRootPane().putClientProperty(WINDOW_MODIFIED, Boolean.TRUE); } }
private void updateTitle() { String postfix = ""; if (!Platform.onMac()) { postfix = (documentChanged ? " *" : ""); } else { getRootPane().putClientProperty("Window.documentModified", documentChanged); } if (documentFile == null) { setTitle("Untitled" + postfix); } else { setTitle(documentFile.getName() + postfix); getRootPane().putClientProperty("Window.documentFile", documentFile); } }
public NodeSelectionDialog(Frame owner, NodeLibrary library, NodeRepository repository) { super(owner, "New Node", true); getRootPane().putClientProperty("Window.style", "small"); JPanel panel = new JPanel(new BorderLayout()); this.repository = repository;
public ProgressDialog(Frame owner, String title) { super(owner, title, false); getRootPane().putClientProperty("Window.style", "small"); setResizable(false); setLayout(null); Container contentPane = getContentPane(); contentPane.setLayout(null); tasksCompleted = 0; this.taskCount = 0; progressBar = new JProgressBar(JProgressBar.HORIZONTAL, 0, taskCount); progressBar.setIndeterminate(true); progressBar.setBounds(10, 10, 300, 32); contentPane.add(progressBar); progressLabel = new JLabel(); progressLabel.setBounds(320, 10, 50, 32); progressLabel.setVisible(false); contentPane.add(progressLabel); messageLabel = new JLabel(); messageLabel.setBounds(10, 40, 380, 32); contentPane.add(messageLabel); updateProgress(); setSize(400, 100); setLocationRelativeTo(owner); }
getRootPane().putClientProperty("Window.documentFile", file);
public ColorDialog(Frame owner) { super(owner, "Choose Color"); getRootPane().putClientProperty("Window.style", "small"); colorField = new ColorField();
private void init(Element region) { try { robot = new Robot(); } catch (AWTException e1) { e1.printStackTrace(); } content = getJPanel(); _region = region; Rectangle rect = _region.getRectangle(); content.setPreferredSize(rect.getSize()); add(content); setBounds(rect); getRootPane().putClientProperty("Window.shadow", Boolean.FALSE); ((JPanel) getContentPane()).setDoubleBuffered(true); setVisible(false); setFocusableWindowState(false); }
/** Keep track of the alpha level, since we can't read it from * the window itself. */ private void storeAlpha(Window w, byte alpha) { if (w instanceof RootPaneContainer) { JRootPane root = ((RootPaneContainer)w).getRootPane(); Byte b = alpha == (byte)0xFF ? null : new Byte(alpha); root.putClientProperty(TRANSPARENT_ALPHA, b); } }
/** * Puts {@code Window} bounds to client property. * @param window the target {@code Window} * @param bounds bounds */ public static void putWindowNormalBounds(Window window, Rectangle bounds) { if (window instanceof JFrame) { ((JFrame) window).getRootPane().putClientProperty( WINDOW_STATE_NORMAL_BOUNDS, bounds); } }
/** Keep track of the alpha level, since we can't read it from * the window itself. */ private void storeAlpha(Window w, byte alpha) { if (w instanceof RootPaneContainer) { JRootPane root = ((RootPaneContainer)w).getRootPane(); Byte b = alpha == (byte)0xFF ? null : Byte.valueOf(alpha); root.putClientProperty(TRANSPARENT_ALPHA, b); } }
@Override public void init(Controller controller) { final JComponent mainContentPane = getMainContentPane(); mainContentPane.add(toolbarPanel[TOP], BorderLayout.NORTH); mainContentPane.add(toolbarPanel[LEFT], BorderLayout.WEST); mainContentPane.add(toolbarPanel[RIGHT], BorderLayout.EAST); mainContentPane.add(toolbarPanel[BOTTOM], BorderLayout.SOUTH); status.setText(""); status.setVisible(false); mainContentPane.getRootPane().putClientProperty(Controller.class, controller); }
@Override protected void done(Movie movie) { getRootPane().putClientProperty("Window.documentFile", newFile); setTitle(newFile.getName()); movieConverterPanel.setMovie(movie); }
private void fixWindowDragging(Window w, String context) { if (w instanceof RootPaneContainer) { JRootPane p = ((RootPaneContainer)w).getRootPane(); Boolean oldDraggable = (Boolean)p.getClientProperty(WDRAG); if (oldDraggable == null) { p.putClientProperty(WDRAG, Boolean.FALSE); if (w.isDisplayable()) { System.err.println(context + "(): To avoid content dragging, " + context + "() must be called before the window is realized, or " + WDRAG + " must be set to Boolean.FALSE before the window is realized. If you really want content dragging, set " + WDRAG + " on the window's root pane to Boolean.TRUE before calling " + context + "() to hide this message."); } } } }
private void fixWindowDragging(Window w, String context) { if (w instanceof RootPaneContainer) { JRootPane p = ((RootPaneContainer)w).getRootPane(); Boolean oldDraggable = (Boolean)p.getClientProperty(WDRAG); if (oldDraggable == null) { p.putClientProperty(WDRAG, Boolean.FALSE); if (w.isDisplayable()) { LOG.log(Level.WARNING, "{0}(): To avoid content dragging, {1}() must be called before the window is realized, or " + WDRAG + " must be set to Boolean.FALSE before the window is realized. If you really want content dragging, set " + WDRAG + " on the window''s root pane to Boolean.TRUE before calling {2}() to hide this message.", new Object[]{context, context, context}); } } } }
private void updateDirtyFlag() { if (OSUtils.isOSX()){ // only currently implemented for OSX because it has a standard mechanism // set the modified indicator on the frame getRootPane().putClientProperty(WINDOW_MODIFIED, !getOWLModelManager().getDirtyOntologies().isEmpty()); } }
public BuApplet() { super(); getRootPane().putClientProperty ("defeatSystemEventQueueCheck",Boolean.TRUE); setImplementation(new BuCommonImplementation()); }
protected void setSaveNeeded(boolean saveNeeded) { if(getFrame()!=null && this.saveNeeded!=saveNeeded) { this.saveNeeded = saveNeeded; // Marks/unmarks the window as dirty under Mac OS X (symbolized by a dot in the window closing icon) if(OsFamily.MAC_OS_X.isCurrent()) getFrame().getRootPane().putClientProperty("windowModified", saveNeeded?Boolean.TRUE:Boolean.FALSE); } }
public void setDirty() { if(!XJApplication.shared().supportsPersistence()) return; // Use dirty member to speed up if(!dirty) { dirty = true; getRootPane().putClientProperty(PROPERTY_WINDOW_MODIFIED, Boolean.TRUE); menuItemStatusChanged(XJMainMenuBar.MI_SAVE); updateTitle(); dirtyChanged(); } }
private void updateDirtyFlag() { WorkspaceManager workspaceManager = ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager(); JFrame frame = workspaceManager.getFrame(this); Set<OWLOntology> dirtyOntologies = getOWLModelManager().getDirtyOntologies(); boolean dirty = false; for (OWLOntology ont : getOWLModelManager().getOntologies()) { if (dirtyOntologies.contains(ont)) { dirty = true; break; } } frame.getRootPane().putClientProperty(WINDOW_MODIFIED, dirty); }
public HTMLDialog createHtmlEditor(final RootPaneContainer frame) throws Exception { final JRootPane rootPane = frame.getRootPane(); HTMLDialog htmlEditorWindow = (HTMLDialog) rootPane.getClientProperty(HTMLDialog.class); if (htmlEditorWindow == null) { htmlEditorWindow = new HTMLDialog(this, "", "", frame); rootPane.putClientProperty(HTMLDialog.class, htmlEditorWindow); // make sure that SHTML gets notified of relevant config changes! ResourceController.getResourceController().addPropertyChangeListener( new FreeplaneToSHTMLPropertyChangeAdapter(htmlEditorWindow.getHtmlEditorPanel())); } return htmlEditorWindow; }