/** * Create a new JTitledPanel with the given String as the title, and the * given Container as the content panel. * * @param title * @param content */ public JXTitledPanel(String title, Container content) { setTitle(title); setContentContainer(content); }
public void setTitleFont(Font titleFont) { Font old = getTitleFont(); this.titleFont = titleFont; firePropertyChange("titleFont", old, getTitleFont()); }
public void setTitleForeground(Color titleForeground) { Color old = getTitleForeground(); this.titleForeground = titleForeground; firePropertyChange("titleForeground", old, getTitleForeground()); }
protected void installComponents(JXTitledPanel titledPanel) { topPanel.add(caption, new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, getCaptionInsets(), 0, 0)); if (titledPanel.getClientProperty(JXTitledPanel.RIGHT_DECORATION) instanceof JComponent) { setRightDecoration((JComponent) titledPanel.getClientProperty(JXTitledPanel.RIGHT_DECORATION)); } if (titledPanel.getClientProperty(JXTitledPanel.LEFT_DECORATION) instanceof JComponent) { setLeftDecoration((JComponent) titledPanel.getClientProperty(JXTitledPanel.LEFT_DECORATION)); } // swingx#500 if (!(titledPanel.getLayout() instanceof BorderLayout)){ titledPanel.setLayout(new BorderLayout()); } titledPanel.add(topPanel, BorderLayout.NORTH); // fix #1063-swingx: must respect custom border if (SwingXUtilities.isUIInstallable(titledPanel.getBorder())) { // use uiresource border // old was: BorderFactory.createRaisedBevelBorder()); titledPanel.setBorder(BorderUIResource.getRaisedBevelBorderUIResource()); } }
jXTitledPanel1 = new org.jdesktop.swingx.JXTitledPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tree = new org.jdesktop.swingx.JXTree(); jSplitPane1.setDividerSize(4); jXTitledPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/geotools/gui/swing/propertyedit/Bundle"); // NOI18N jXTitledPanel1.setTitle(bundle.getString("editor")); // NOI18N jXTitledPanel1.setTitleFont(jXTitledPanel1.getTitleFont().deriveFont(jXTitledPanel1.getTitleFont().getStyle() | java.awt.Font.BOLD)); jXTitledPanel1.getContentContainer().setLayout(new java.awt.BorderLayout()); jScrollPane1.setViewportView(tree); jXTitledPanel1.getContentContainer().add(jScrollPane1, java.awt.BorderLayout.CENTER);
protected JLabel createAndConfigureCaption(final JXTitledPanel titledPanel) { JLabel caption = new JLabel(titledPanel.getTitle()){ //#501 @Override public void updateUI(){ super.updateUI(); setForeground(titledPanel.getTitleForeground()); setFont(titledPanel.getTitleFont()); } }; caption.setFont(titledPanel.getTitleFont()); caption.setForeground(titledPanel.getTitleForeground()); return caption; }
/** * Adds the given JComponent as a decoration on the left of the title * * @param decoration */ public void setLeftDecoration(JComponent decoration) { JComponent old = getLeftDecoration(); getUI().setLeftDecoration(decoration); firePropertyChange("leftDecoration", old, getLeftDecoration()); }
/** * Adds the given JComponent as a decoration on the right of the title * * @param decoration */ public void setRightDecoration(JComponent decoration) { JComponent old = getRightDecoration(); getUI().setRightDecoration(decoration); firePropertyChange("rightDecoration", old, getRightDecoration()); }
@Override public void updateUI(){ super.updateUI(); setForeground(titledPanel.getTitleForeground()); setFont(titledPanel.getTitleFont()); } };
/** * Set the Painter to use for painting the title section of the JXTitledPanel. * This value may be null, which will cause the current look and feel to paint * an appropriate look * * @param p The Painter to use. May be null */ public void setTitlePainter(Painter p) { Painter old = getTitlePainter(); this.titlePainter = p; firePropertyChange("titlePainter", old, getTitlePainter()); }
/** * Sets the title for this title panel. * * @param title * the title to display */ public void setTitle(String title) { String oldTitle = this.title; this.title = (title == null ? "" : title); // JW: fix swingx #9 - missing/incorrect notification // let standard notification handle // NOTE - "getting" the new property in the fire method is // intentional: there's no way of missing any transformations // on the parameter to set (like above: setting a // value depending on whether the input is null). firePropertyChange("title", oldTitle, getTitle()); }
mainPanel = new org.jdesktop.swingx.JXTitledPanel(); iconListScrollPane = new javax.swing.JScrollPane(); iconList = new JXList(true); setTitle("Select New Value"); mainPanel.setTitle(listTitle); mainPanel.setTitleFont(new java.awt.Font("SansSerif", 1, 14)); mainPanel.getContentContainer()); mainPanel.getContentContainer().setLayout(mainPanelLayout); mainPanelLayout .setHorizontalGroup(mainPanelLayout
@Override protected void installComponents(JXTitledPanel titledPanel) { super.installComponents(titledPanel); Border currBorder = titledPanel.getBorder(); if ((currBorder == null) || (currBorder instanceof UIResource)) { titledPanel .setBorder(new BorderUIResource.CompoundBorderUIResource( new EmptyBorder(2, 2, 2, 2), new CompoundBorder( ShadowPopupBorder.getInstance(), new SubstanceBorder()))); } }
/** * Create a new JTitledPanel with the given title as the title for the * panel. * * @param title */ public JXTitledPanel(String title) { this(title, createDefaultContainer()); }
public Container getContentContainer() { if (contentPanel == null) { contentPanel = new JXPanel(); ((JXPanel) contentPanel).setBorder(BorderFactory .createEmptyBorder()); this.add(contentPanel, BorderLayout.CENTER); } return contentPanel; }
protected void installListeners(final JXTitledPanel titledPanel) { titleChangeListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("title")) { caption.setText((String)evt.getNewValue()); } else if (evt.getPropertyName().equals("titleForeground")) { caption.setForeground((Color)evt.getNewValue()); } else if (evt.getPropertyName().equals("titleFont")) { caption.setFont((Font)evt.getNewValue()); } else if ("titlePainter".equals(evt.getPropertyName())) { topPanel.setBackgroundPainter(titledPanel.getTitlePainter()); topPanel.repaint(); } } }; titledPanel.addPropertyChangeListener(titleChangeListener); }
public ProgressInformationPanel(final boolean running) { super(WidgetUtils.COLOR_DEFAULT_BACKGROUND); setLayout(new BorderLayout()); _tableProgressInformationPanels = new ConcurrentHashMap<>(); _progressTimingCounters = new ConcurrentHashMap<>(); _stopWatch = Stopwatch.createUnstarted(); _executionLogTextArea = new JTextArea(); _executionLogTextArea.setText("--- DataCleaner progress information user-log ---"); _executionLogTextArea.setEditable(false); _executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND); _progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); _progressBarPanel.setLayout(new VerticalLayout(4)); final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE); progressTaskPane.add(_progressBarPanel); final JXTitledPanel executionLogPanel = WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea)); executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND)); final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer(); taskPaneContainer.setLayout(new BorderLayout(MARGIN, MARGIN)); if (running) { taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH); } setBorder(new MatteBorder(0, 0, MARGIN, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND)); taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER); add(taskPaneContainer, BorderLayout.CENTER); }
private ValueSelectDialog(VisualPropertyType type, Window parent, boolean modal) { super(Cytoscape.getDesktop(), modal); final Toolkit toolkit = this.getToolkit(); final Dimension screenSize = toolkit.getScreenSize(); height = (int) (screenSize.getHeight() * 0.7); this.type = type; iconMap = this.type.getVisualProperty().getIconSet(); initComponents(); setList(); // Special case handling // TODO: Create more user-friendly GUI only for Custom Graphics. if (type.equals(NODE_CUSTOM_GRAPHICS_1)) { this.iconList.setFixedCellHeight(ICON_CELL_HEIGHT); this.listTitle = "Custom Graphics"; } else { this.listTitle = type.getName(); } mainPanel.setTitle(listTitle); // get original value and set the selected item. if (type.isNodeProp()) originalValue = Cytoscape.getVisualMappingManager() .getVisualStyle().getNodeAppearanceCalculator() .getDefaultAppearance().get(type); else originalValue = Cytoscape.getVisualMappingManager() .getVisualStyle().getEdgeAppearanceCalculator() .getDefaultAppearance().get(type); }
protected void installComponents(JXTitledPanel titledPanel) { topPanel.add(caption, new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, getCaptionInsets(), 0, 0)); if (titledPanel.getClientProperty(JXTitledPanel.RIGHT_DECORATION) instanceof JComponent) { setRightDecoration((JComponent) titledPanel.getClientProperty(JXTitledPanel.RIGHT_DECORATION)); } if (titledPanel.getClientProperty(JXTitledPanel.LEFT_DECORATION) instanceof JComponent) { setLeftDecoration((JComponent) titledPanel.getClientProperty(JXTitledPanel.LEFT_DECORATION)); } // swingx#500 if (!(titledPanel.getLayout() instanceof BorderLayout)){ titledPanel.setLayout(new BorderLayout()); } titledPanel.add(topPanel, BorderLayout.NORTH); // fix #1063-swingx: must respect custom border if (SwingXUtilities.isUIInstallable(titledPanel.getBorder())) { // use uiresource border // old was: BorderFactory.createRaisedBevelBorder()); titledPanel.setBorder(BorderUIResource.getRaisedBevelBorderUIResource()); } }