/** Constructs rest of dialog. */ private void draw () { list = new JList(listModel); list.setBorder(new EmptyBorder(2, 2, 2, 2)); list.addListSelectionListener (new ListSelectionListener () { @Override public void valueChanged (ListSelectionEvent evt) { updateSaveButton (); } } ); // bugfix 37941, select first item in list if (!listModel.isEmpty ()) { list.setSelectedIndex (0); } else { updateSaveButton (); } JScrollPane scroll = new JScrollPane (list); scroll.setBorder (new CompoundBorder (new EmptyBorder (12, 12, 11, 0), scroll.getBorder ())); add(scroll, BorderLayout.CENTER); list.setCellRenderer(new ExitDlgListCellRenderer()); list.getAccessibleContext().setAccessibleName((NbBundle.getBundle(ExitDialog.class)).getString("ACSN_ListOfChangedFiles")); list.getAccessibleContext().setAccessibleDescription((NbBundle.getBundle(ExitDialog.class)).getString("ACSD_ListOfChangedFiles")); this.getAccessibleContext().setAccessibleDescription((NbBundle.getBundle(ExitDialog.class)).getString("ACSD_ExitDialog")); }
/** * Adds a new zone in the StatusBar * * @param id * @param zone * @param constraints one of the constraint support by the * {@link com.l2fprod.common.swing.PercentLayout} */ public void addZone(String id, Component zone, String constraints) { // is there already a zone with this id? Component previousZone = getZone(id); if (previousZone != null) { remove(previousZone); idToZones.remove(id); } if (zone instanceof JComponent) { JComponent jc = (JComponent) zone; if (jc.getBorder() == null || jc.getBorder() instanceof UIResource) { if (jc instanceof JLabel) { jc.setBorder( new CompoundBorder(zoneBorder, new EmptyBorder(0, 2, 0, 2))); // ((JLabel) jc).setText(" "); } else { jc.setBorder(zoneBorder); } } } add(zone, constraints); idToZones.put(id, zone); }
@Override public JDialog create(Consumer<JPanel> consumer) { try { window.setIconImage(new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/VISNode_64.png"))).getImage()); } catch (IOException ex) { ExceptionHandler.get().handle(ex); } JPanel container = new JPanel(new BorderLayout()); container.setBorder(new CompoundBorder(new EmptyBorder(3, 3, 3, 3), new CompoundBorder(BorderFactory.createEtchedBorder(), new EmptyBorder(6, 6, 6, 6)))); consumer.accept(container); window.getContentPane().setLayout(new BorderLayout()); window.getContentPane().add(container); window.pack(); window.setLocationRelativeTo(null); return window; }
public TransparentSectionButton(ActionListener al) { // force initialization of PropSheet look'n'feel values UIManager.get( "nb.propertysheet" ); setMargin(new Insets(0, 3, 0, 3)); setFocusPainted( false ); setHorizontalAlignment( SwingConstants.LEFT ); setHorizontalTextPosition( SwingConstants.RIGHT ); setVerticalTextPosition( SwingConstants.CENTER ); updateProperties(); if( getBorder() instanceof CompoundBorder ) { // from BasicLookAndFeel Dimension pref = getPreferredSize(); pref.height -= 3; setPreferredSize( pref ); } if(al != null) { addActionListener(al); } initActions(); }
private void showProblem(Problem problem) { if(dialog == null) { return; } if (problem == null) { label.setText(" "); // NOI18N innerPanel.setBorder(null); next.setEnabled(!isPreviewRequired()); previewButton.setEnabled(true); return; } innerPanel.setBorder(new CompoundBorder(new javax.swing.border.LineBorder(java.awt.Color.gray), new EmptyBorder(0, 2, 2, 2))); progressPanel.setVisible(true); if (problem.isFatal()) { displayError(problem.getMessage()); } else { displayWarning(problem.getMessage()); } dialog.pack(); }
private void adjustToolbarComponentSize(JComponent button) { if (adjusted.contains(button)) return; // as we cannot get the button small enough using the margin and border... if (button.getBorder() instanceof CompoundBorder) { // from BasicLookAndFeel Dimension pref = button.getPreferredSize(); // XXX #41827 workaround w2k, that adds eclipsis (...) instead of actual text if ("Windows".equals(UIManager.getLookAndFeel().getID())) { // NOI18N pref.width += 9; } button.setPreferredSize(pref); } adjusted.add(button); }
static BorderBuilder fromField(Instance instance, String field, boolean uiresource, Heap heap) { Object _border = instance.getValueOfField(field); if (!(_border instanceof Instance)) return null; Instance border = (Instance)_border; // Make sure subclasses are listed before base class if using isSubclassOf if (DetailsUtils.isSubclassOf(border, BevelBorder.class.getName())) { return new BevelBorderBuilder(border, heap); } else if (DetailsUtils.isSubclassOf(border, MatteBorder.class.getName())) { // Must be before EmptyBorder (extends EmptyBorder) return new EmptyBorderBuilder(border, heap); } else if (DetailsUtils.isSubclassOf(border, EmptyBorder.class.getName())) { return new MatteBorderBuilder(border, heap); } else if (DetailsUtils.isSubclassOf(border, EtchedBorder.class.getName())) { return new EtchedBorderBuilder(border, heap); } else if (DetailsUtils.isSubclassOf(border, LineBorder.class.getName())) { return new LineBorderBuilder(border, heap); } else if (DetailsUtils.isSubclassOf(border, TitledBorder.class.getName())) { return new TitledBorderBuilder(border, heap); } else if (DetailsUtils.isSubclassOf(border, CompoundBorder.class.getName())) { return new CompoundBorderBuilder(border, heap); } return null; }
private void initComponents2() { header = new HeaderPanel(); title = header.getTitle(); button = header.getButton(); button2 = header.getButton2(); Border outsideBorder = BorderFactory.createMatteBorder(0, 0, 1, 0, Color.gray); Border insideBorder = BorderFactory.createEmptyBorder(3, 3, 3, 3); CompoundBorder compoundBorder = BorderFactory.createCompoundBorder(outsideBorder, insideBorder); header.setBorder(compoundBorder); button.setVisible(false); button2.setVisible(false); rightCornerHeader = new JPanel(); rightCornerHeader.setBorder(compoundBorder); Color headerBgColor = UnitTable.getDarkerColor(getBackground()); header.setBackground(headerBgColor); if (button != null) { button.setOpaque(false); } if (button2 != null) { button2.setOpaque(false); } rightCornerHeader.setBackground(headerBgColor); setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 0)); }
void setSelected () { if (isMac) { setBorder(new CompoundBorder ( new VariableBorder(null, selectedB, null, selectedB), BorderFactory.createEmptyBorder(5, 5, 3, 5) )); } else { setBorder (new CompoundBorder ( new CompoundBorder ( new LineBorder (getTabPanelBackground()), new LineBorder (selectedB) ), new EmptyBorder (0, 2, 0, 2) )); } setBackground (selected); }
void setHighlighted() { if (!isMac) { setBorder(new CompoundBorder( new CompoundBorder( new LineBorder(getTabPanelBackground()), new LineBorder(highlightedB) ), new EmptyBorder(0, 2, 0, 2) )); setBackground(highlighted); } if (!category.isHighlited()) { if (categoryModel.getHighlitedCategoryID() != null) { CategoryButton b = buttons.get(categoryModel.getHighlitedCategoryID()); if (b != null && !b.category.isCurrent()) { b.setNormal(); } } categoryModel.setHighlited(category,true); } }
void handleSummary(Summary summary) { inSummary = true; JComponent summaryComp = (JComponent) summary.getSummaryComponent(); // XXX if (summaryComp.getBorder() != null) { CompoundBorder b = new CompoundBorder(new EmptyBorder(5, 5, 5, 5), summaryComp .getBorder()); summaryComp.setBorder(b); } setCurrentWizardPanel(summaryComp); // XXX instructions.setInSummaryPage(true); ttlLabel.setText(NbBridge.getString("org/netbeans/api/wizard/Bundle", // NOI18N WizardDisplayerImpl.class, "Summary")); // NOI18N getButtonManager().setSummaryShowingMode(); summaryComp.requestFocus(); }
private JPanel createTitlePanel() { JPanel title = new JPanel(new BorderLayout()); title.add(Guitilities.createGradientTitle(getTranslation("components.title")), BorderLayout.NORTH); JPanel interact = new JPanel(); interact.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND)); interact.setLayout(new BoxLayout(interact, BoxLayout.X_AXIS)); interact.setBorder(new CompoundBorder(Guitilities.CHISEL_BORDER, new EmptyBorder(12, 8, 12, 8))); final JCheckBox checkImages = new JCheckBox(getTranslation("group.images"), true); checkImages.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND)); checkImages.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { for(ComponentButton button:componentButtons) button.setIconVisible(checkImages.isSelected()); for(CollapsiblePanel panel:collapsiblePanels) panel.setExpanded(false); } }); interact.add(checkImages); title.add(interact, BorderLayout.CENTER); return title; }
@Override public void addCustomEntriesToTable(UIDefaults table) { Border blackLineBorder = new BorderUIResource(new LineBorder(getBlack())); Border whiteLineBorder = new BorderUIResource(new LineBorder(getWhite())); Object textBorder = new BorderUIResource(new CompoundBorder( blackLineBorder, new BasicBorders.MarginBorder())); table.put("ToolTip.border", blackLineBorder); table.put("TitledBorder.border", blackLineBorder); table.put("Table.focusCellHighlightBorder", whiteLineBorder); table.put("Table.focusCellForeground", getWhite()); table.put("TextField.border", textBorder); table.put("PasswordField.border", textBorder); table.put("TextArea.border", textBorder); table.put("TextPane.font", textBorder); }
public WaveChart(String chartContent,String title,String yaxisName) { super(); this.chart=createChart(chartContent,title,yaxisName); addChart(this.chart); // 将JFreeChart放在专用的图表容器ChartPanel中 this.chartPanel = new ChartPanel(this.chart); this.chartPanel.setPreferredSize(new Dimension(500, 350)); // 设置chartPanel容器边框 CompoundBorder compoundBorder = BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(1, 1,1, 1), BorderFactory.createEtchedBorder()); this.chartPanel.setBorder(compoundBorder); // 将chartPanel加入到本容器中 add(this.chartPanel); }
private static Container createTop(Advantage advantage, int remaining) { JPanel top = new JPanel(new ColumnLayout()); JLabel label = new JLabel(Text.truncateIfNecessary(advantage.toString(), 80, SwingConstants.RIGHT), SwingConstants.LEFT); top.setBorder(new EmptyBorder(0, 0, 15, 0)); if (remaining > 0) { String msg; if (remaining == 1) { msg = MODIFIER_ONE_REMAINING; } else { msg = MessageFormat.format(MODIFIER_REMAINING, Integer.valueOf(remaining)); } top.add(new JLabel(msg, SwingConstants.CENTER)); } label.setBorder(new CompoundBorder(new LineBorder(), new EmptyBorder(0, 2, 0, 2))); label.setOpaque(true); top.add(new JPanel()); top.add(label); return top; }
private void uiStyle () { content.setBackground(new Color(36, 36, 36)); content.setForeground(new Color(255, 255, 255)); bottomPanel.setBackground(new Color(36, 36, 36)); bottomPanel.setForeground(new Color(255, 255, 255)); buttonPanel.setBackground(new Color(36, 36, 36)); buttonPanel.setForeground(new Color(255, 255, 255)); linkText.setForeground(new Color(20, 150, 20)); contentPane.setBackground(new Color(36, 36, 36)); Border line = BorderFactory.createLineBorder(new Color(80, 80, 80)); Border empty = new EmptyBorder(4, 4, 4, 4); CompoundBorder border = new CompoundBorder(line, empty); mavenTextField.setBorder(border); mavenTextField.setCaretColor(new Color(255, 255, 255)); mavenTextField.setBackground(new Color(46, 46, 46)); mavenTextField.setForeground(new Color(255, 255, 255)); }
private void setUpControlComponent() { JLabel rateLabel = new JLabel("Rate:", JLabel.RIGHT); JPanel mainPanel = new JPanel(); int GAP = 10; Border emptyBorder = new EmptyBorder(GAP,GAP,GAP,GAP); Border etchedBorder = new CompoundBorder( new EtchedBorder(), emptyBorder); Border titledBorder = new TitledBorder( etchedBorder, "Rate Control"); mainPanel.setBorder(titledBorder); mainPanel.setLayout( new BorderLayout(GAP, GAP) ); mainPanel.add(rateLabel, BorderLayout.CENTER); mainPanel.add(rateField, BorderLayout.EAST); controlComponent.add(mainPanel); }
/** * Build border and title the control component. */ private void setUpControlComponent() { JLabel timeLabel = new JLabel("Media Time:", JLabel.RIGHT); JPanel mainPanel = new JPanel(); int GAP = 10; Border emptyBorder = new EmptyBorder(GAP,GAP,GAP,GAP); Border etchedBorder = new CompoundBorder( new EtchedBorder(), emptyBorder); Border titledBorder = new TitledBorder( etchedBorder, "Time Display Control"); mainPanel.setBorder(titledBorder); mainPanel.setLayout( new BorderLayout(GAP, GAP) ); mainPanel.add(timeLabel, BorderLayout.CENTER); mainPanel.add(timerField, BorderLayout.EAST); controlComponent.add(mainPanel); }
/** * Create a panel in which a JDesktopPane is used to * to display screens for viewing a Player. * * @param title * Title displayed in border of JDesktopPane */ public ViewingPanel(String title) { TitledBorder tb; setLayout(new BorderLayout()); desktop = new JDesktopPane(); desktop.setLayout(new TileLayout()); desktop.setBorder(tb = new TitledBorder( new CompoundBorder( new EtchedBorder(), new EmptyBorder(4, 4, 4, 4)), title)); tb.setTitleColor(Color.black); desktop.setOpaque(false); desktop.setBackground(UIManager.getColor("control")); add(desktop, BorderLayout.CENTER); hash = new Hashtable(); }
/** * Adds a new zone in the StatusBar * * @param id * @param zone * @param constraints one of the constraint support by the * {@link com.l2fprod.common.swing.PercentLayout} */ public void addZone(String id, Component zone, String constraints) { // is there already a zone with this id? Component previousZone = getZone(id); if (previousZone != null) { remove(previousZone); idToZones.remove(id); } if (zone instanceof JComponent) { JComponent jc = (JComponent)zone; if (jc.getBorder() == null || jc.getBorder() instanceof UIResource) { if (jc instanceof JLabel) { jc.setBorder( new CompoundBorder(zoneBorder, new EmptyBorder(0, 2, 0, 2))); ((JLabel)jc).setText(" "); } else { jc.setBorder(zoneBorder); } } } add(zone, constraints); idToZones.put(id, zone); }
protected void installDefaults() { Border b = bar.getBorder(); if (b == null || b instanceof UIResource) { bar.setBorder( new BorderUIResource( new CompoundBorder( BorderFactory.createLineBorder( UIManager.getColor("controlDkShadow")), BorderFactory.createEmptyBorder(1, 1, 1, 1)))); } Color color = bar.getBackground(); if (color == null || color instanceof ColorUIResource) { bar.setOpaque(true); bar.setBackground(new ColorUIResource(Color.white)); } }
protected void installDefaults() { Border b = bar.getBorder(); if (b == null || b instanceof UIResource) { bar.setBorder( new BorderUIResource( new CompoundBorder( BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(2, 2, 2, 2)))); } if (bar.getBackground() == null || bar.getBackground() instanceof UIResource) { bar.setBackground(new ColorUIResource(128, 128, 128)); bar.setOpaque(true); } }
/** * Builds the panel. */ protected void build() { setBorder(new EmptyBorder(DLU_100Y / 40, DLU_100X / 40, DLU_100Y / 40, DLU_100X / 40)); CellConstraints cc = new CellConstraints(); JPanel mainPanel = new JPanel(new FormLayout("pref:grow", "3*(pref, 3dlu), 0:grow")); mainPanel.setBorder(new EmptyBorder(DLU_100Y / 20, DLU_100X / 20, DLU_100Y / 20, DLU_100X / 20)); mainPanel.add(buildSelection(cc), cc.xy(1, 1)); mainPanel.add(buildStatus(cc), cc.xy(1, 3)); if (engineSettings != null) { JPanel engine = new JPanel(new BorderLayout()); engine.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), String.format( Messages.getString("Engine.Settings"), player.name())), new EmptyBorder(DLU_100Y / 10, DLU_100X / 10, DLU_100Y / 10, DLU_100X / 10) )); engine.add(engineSettings, BorderLayout.CENTER); mainPanel.add(engine, cc.xy(1, 5)); } setViewportView(mainPanel); }
private KSUCreditsWindow( Frame parent ) { super( parent ); JLabel label = new JLabel( TRANSLATED_BY ); label.setFont( new PhetFont( 18 ) ); JLabel logo = new JLabel( new ImageIcon( PhetCommonResources.getImage( "logos/ECSME-KSU-logos.jpg" ) ) ); VerticalLayoutPanel panel = new VerticalLayoutPanel(); int margin = 12; panel.setBorder( new CompoundBorder( new LineBorder( Color.BLACK, 1 ), new EmptyBorder( margin, margin, margin, margin ) ) ); panel.add( label ); panel.add( Box.createVerticalStrut( 5 ) ); panel.add( logo ); setContentPane( panel ); pack(); // click on the window to make it go away addMouseListener( new MouseAdapter() { @Override public void mousePressed( MouseEvent event ) { dispose(); } } ); }
public ComponentPanel() { setBorder( new CompoundBorder( new LineBorder( Color.BLACK, 1 ), new EmptyBorder( 5, 14, 5, 14 ) ) ); setBackground( new Color( 180, 205, 255 ) ); // components label = new JLabel( "JLabel" ); checkBox = new JCheckBox( "JCheckBox" ); radioButton = new JRadioButton( "JRadioButton" ); // layout setLayout( new GridBagLayout() ); constraints = new GridBagConstraints(); constraints.anchor = GridBagConstraints.WEST; constraints.gridx = 0; constraints.gridy = GridBagConstraints.RELATIVE; addComponent( label ); addComponent( checkBox ); addComponent( radioButton ); }
/** * Returns the rendered header cell for the supplied value and column. * * @param jtRevokedCerts The JTable * @param value The value to assign to the cell * @param bIsSelected True if cell is selected * @param iRow The row of the cell to render * @param iCol The column of the cell to render * @param bHasFocus If true, render cell appropriately * @return The rendered cell */ @Override public Component getTableCellRendererComponent(JTable jtRevokedCerts, Object value, boolean bIsSelected, boolean bHasFocus, int iRow, int iCol) { // Get header renderer JLabel header = (JLabel) jtRevokedCerts.getColumnModel().getColumn(iCol).getHeaderRenderer(); // The headers contain text header.setText(value.toString()); header.setHorizontalAlignment(LEFT); // Set tool tips if (iCol == 0) { header.setToolTipText(RB.getString("RevokedCertsTableHeadRend.SerialNumberColumn.tooltip")); } else { header.setToolTipText(RB.getString("RevokedCertsTableHeadRend.RevocationDateColumn.tooltip")); } header.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new EmptyBorder(0, 5, 0, 5))); return header; }
/** * Returns the rendered header cell for the supplied value and column. * * @param jtJarInfo The JTable * @param value The value to assign to the cell * @param bIsSelected True if cell is selected * @param iRow The row of the cell to render * @param iCol The column of the cell to render * @param bHasFocus If true, render cell appropriately * @return The rendered cell */ @Override public Component getTableCellRendererComponent(JTable jtJarInfo, Object value, boolean bIsSelected, boolean bHasFocus, int iRow, int iCol) { // Get header renderer JLabel header = (JLabel) jtJarInfo.getColumnModel().getColumn(iCol).getHeaderRenderer(); // The headers contain left-aligned text header.setText(value.toString()); header.setHorizontalAlignment(LEFT); header.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new EmptyBorder(0, 5, 0, 5))); return header; }
/** * Returns the rendered header cell for the supplied value and column. * * @param jtSystemProperties The JTable * @param value The value to assign to the cell * @param bIsSelected True if cell is selected * @param iRow The row of the cell to render * @param iCol The column of the cell to render * @param bHasFocus If true, render cell appropriately * @return The rendered cell */ @Override public Component getTableCellRendererComponent(JTable jtSystemProperties, Object value, boolean bIsSelected, boolean bHasFocus, int iRow, int iCol) { // Get header renderer JLabel header = (JLabel) jtSystemProperties.getColumnModel().getColumn(iCol).getHeaderRenderer(); // The headers contain left-aligned text header.setText(value.toString()); header.setHorizontalAlignment(LEFT); header.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new EmptyBorder(0, 5, 0, 5))); return header; }
public void init() { this.setLayout(new BorderLayout(0,0)); this.setPreferredSize(new Dimension(width, height)); this.setMaximumSize(new Dimension(width, height)); this.setMinimumSize(new Dimension(10,10)); _out.setPreferredSize(new Dimension(width, height)); _in.getInputLine().setPreferredSize(new Dimension(width, 20)); _in.getInputLine().setMaximumSize(new Dimension(width, 0)); _out.setMaximumSize(new Dimension(width, 0)); _out.setMinimumSize(new Dimension(10,10)); _in.getInputLine().setMinimumSize(new Dimension(10,10)); this.add(_out, BorderLayout.CENTER); this.add(_in.getInputLine(), BorderLayout.SOUTH); setBorder(new CompoundBorder(BorderFactory.createMatteBorder(5, 5, 5, 5, StyleTheme.ACCENT_COLOR), BorderFactory.createMatteBorder(5, 5, 5, 5, StyleTheme.DEFAULT.getBgColor()))); }
/** * Instantiates a new check box panel. */ public CheckBoxPanel() { setOpaque(false); checkBox = new JCheckBox(); checkBox.setMargin(new Insets(0, 0, 0, 0)); label = new TreeLabel(); setLayout(new BorderLayout()); add(checkBox, BorderLayout.WEST); Border border = label.getBorder(); Border margin = new EmptyBorder(0, 3, 0, 0); label.setBorder(new CompoundBorder(border, margin)); add(label, BorderLayout.CENTER); Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon"); checkBox.setFocusPainted((booleanValue != null) && (booleanValue.booleanValue())); selectionForeground = UIManager.getColor("Tree.selectionForeground"); textForeground = UIManager.getColor("Tree.textForeground"); }
private JPanel createCustomBordersPanel() { compound7 = createTextFieldCompound("Custom borders", 7); compound7.textfield1 = new JTextField("red 5 pixel lineborder"); compound7.textfield1.setBorder(new LineBorder(Color.RED, 5)); compound7.textFieldPanel.add(compound7.textfield1); compound7.textfield2 = new JTextField("complex irregular border"); CompoundBorder innerCompound = new CompoundBorder(new EmptyBorder(5, 40, 15, 10), new LineBorder(Color.BLACK)); CompoundBorder outerCompound = new CompoundBorder(new LineBorder(Color.BLACK), innerCompound); compound7.textfield2.setBorder(outerCompound); compound7.textFieldPanel.add(compound7.textfield2); compound7.textfield3 = new JTextField("a titled border", 10); compound7.textfield3.setBorder(new TitledBorder(null, "Freak Out Border", TitledBorder.CENTER, TitledBorder.LEFT)); compound7.textFieldPanel.add(compound7.textfield3); return compound7.panel; }
/** * Recursivly searches a border hierarchy (starting at <code>border) for * a titled border and returns the title if one is found, <code>null</code> * otherwise. * * @param border the border to start search from * * @return the border title of a possibly found titled border */ protected String getBorderTitle(Border border) { String title = null; if (border instanceof CompoundBorder) { CompoundBorder compound = (CompoundBorder) border; Border inner = compound.getInsideBorder(); title = getBorderTitle(inner); if (title == null) { Border outer = compound.getOutsideBorder(); title = getBorderTitle(outer); } } else if (border instanceof TitledBorder) { TitledBorder titled = (TitledBorder) border; title = titled.getTitle(); } return title; }
private void updateDetailsBorder(@Nullable VcsFullCommitDetails data) { if (data == null || !myColorManager.isMultipleRoots()) { myMainContentPanel.setBorder(BorderFactory.createEmptyBorder()); } else { Color color = VcsLogGraphTable.getRootBackgroundColor(data.getRoot(), myColorManager); myMainContentPanel.setBorder(new CompoundBorder(new MatteBorder(0, VcsLogGraphTable.ROOT_INDICATOR_COLORED_WIDTH, 0, 0, color), new MatteBorder(0, VcsLogGraphTable.ROOT_INDICATOR_WHITE_WIDTH, 0, 0, new JBColor(new NotNullProducer<Color>() { @NotNull @Override public Color produce() { return getDetailsBackground(); } })))); } }
public VcsCommitInfoBalloon(@NotNull JTree tree) { myTree = tree; myEditorPane = new JEditorPane(UIUtil.HTML_MIME, ""); myEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); myEditorPane.setEditable(false); myEditorPane.setBackground(HintUtil.INFORMATION_COLOR); myEditorPane.setFont(UIUtil.getToolTipFont()); myEditorPane.setBorder(HintUtil.createHintBorder()); Border margin = IdeBorderFactory.createEmptyBorder(3, 3, 3, 3); myEditorPane.setBorder(new CompoundBorder(myEditorPane.getBorder(), margin)); myEditorPane.addHyperlinkListener(new HyperlinkAdapter() { @Override protected void hyperlinkActivated(HyperlinkEvent e) { BrowserUtil.browse(e.getURL()); } }); myWrapper = new Wrapper(myEditorPane); myPopupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(myWrapper, null); myPopupBuilder.setCancelOnClickOutside(true).setResizable(true).setMovable(true).setRequestFocus(false) .setMinSize(new Dimension(80, 30)); }