Java Code Examples for javax.swing.border.MatteBorder

The following examples show how to use javax.swing.border.MatteBorder. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: runelite   Source File: ScreenMarkerPanel.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
private void updateFill()
{
	final boolean isFullyTransparent = marker.getMarker().getFill().getAlpha() == 0;

	if (isFullyTransparent)
	{
		fillColorIndicator.setBorder(null);
	}
	else
	{
		Color color = marker.getMarker().getFill();
		Color fullColor = new Color(color.getRed(), color.getGreen(), color.getBlue());
		fillColorIndicator.setBorder(new MatteBorder(0, 0, 3, 0, fullColor));
	}

	fillColorIndicator.setIcon(isFullyTransparent ? NO_FILL_COLOR_ICON : FILL_COLOR_ICON);
	opacityIndicator.setIcon(isFullyTransparent ? NO_OPACITY_ICON : FULL_OPACITY_ICON);
}
 
Example 2
Source Project: TencentKona-8   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 3
Source Project: EchoSim   Source File: HistoryCellRenderer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Component getListCellRendererComponent(
        JList<? extends TransactionBean> list,
        TransactionBean value, int index, boolean isSelected,
        boolean cellHasFocus)
{
    JTextPane client = new JTextPane();
    client.setEditable(false);
    client.setContentType("text/html");
    TransactionRenderOpsBean ops = mRuntime.getRenderOps();
    String html = TransactionLogic.renderAsHTML(value, ops);
    int w = list.getFixedCellWidth();
    if (w < 0)
        w = 750;
    else
        w = w*3/4;
    html = "<html><body><table width=\""+w+"px\">"+html+"</table></body></html>";
    client.setText(html);
    if (cellHasFocus)
        client.setBorder(new MatteBorder(1, 5, 1, 1, Color.DARK_GRAY));
    client.setBackground(isSelected ? SELECTED : DESELECTED);
    return client;
}
 
Example 4
Source Project: jdk8u60   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 5
Source Project: JDKSourceCode1.8   Source File: MetaData.java    License: MIT License 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 6
Source Project: openjdk-jdk8u   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 7
Source Project: EchoSim   Source File: HistoryCellRenderer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Component getListCellRendererComponent(
        JList<? extends TransactionBean> list,
        TransactionBean value, int index, boolean isSelected,
        boolean cellHasFocus)
{
    JTextPane client = new JTextPane();
    client.setEditable(false);
    client.setContentType("text/html");
    TransactionRenderOpsBean ops = mRuntime.getRenderOps();
    String html = TransactionLogic.renderAsHTML(value, ops);
    int w = list.getFixedCellWidth();
    if (w < 0)
        w = 750;
    else
        w = w*3/4;
    html = "<html><body><table width=\""+w+"px\">"+html+"</table></body></html>";
    client.setText(html);
    if (cellHasFocus)
        client.setBorder(new MatteBorder(1, 5, 1, 1, Color.DARK_GRAY));
    client.setBackground(isSelected ? SELECTED : DESELECTED);
    return client;
}
 
Example 8
Source Project: javamoney-examples   Source File: DialogHeader.java    License: Apache License 2.0 6 votes vote down vote up
private
void
buildPanel()
{
  getHeader().setBackground(WHITE);
  getHeader().setFont(getHeader().getFont().deriveFont(Font.PLAIN));
  getHeader().setOpaque(true);

  // Build panel.
  setFill(GridBagConstraints.BOTH);
  add(getHeader(), 0, 0, 1, 1, 100, 100);
  add(getIcon(), 1, 0, 1, 1, 0, 0);

  setBackground(WHITE);
  setBorder(new MatteBorder(0, 0, 1, 0, GRAY));
  setInsets(new Insets(5, 5, 5, 5));
}
 
Example 9
public DownloadingProductsPopupPanel(List<Pair<DownloadProductRunnable, DownloadProgressStatus>> downloadingProductRunnables,
                                     int visibleProductCount, int gapBetweenRows, int gapBetweenColumns) {

    super(null);

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    Color separatorColor = UIManager.getColor("controlShadow");
    this.preferredScrollableHeight = 0;
    for (int i=0; i<downloadingProductRunnables.size(); i++) {
        Pair<DownloadProductRunnable, DownloadProgressStatus> pair = downloadingProductRunnables.get(i);
        DownloadingProductPanel downloadingProductPanel = new DownloadingProductPanel(pair.getFirst(), pair.getSecond(), gapBetweenColumns);

        int topLineHeight = (i > 0) ? 1 : 0;
        Border outsideBorder = new MatteBorder(topLineHeight, 0, 0, 0, separatorColor);
        Border insideBorder = new EmptyBorder(gapBetweenRows, gapBetweenColumns, gapBetweenRows, gapBetweenColumns);
        downloadingProductPanel.setBorder(new CompoundBorder(outsideBorder, insideBorder));
        add(downloadingProductPanel);
        if (i < visibleProductCount) {
            this.preferredScrollableHeight += downloadingProductPanel.getPreferredSize().height;
        }
    }
}
 
Example 10
Source Project: keystore-explorer   Source File: KseFrame.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void initStatusBar() {
	jlStatusBar = new JLabel();

	int rightPadding = 3;

	if (OperatingSystem.isMacOs()) {
		rightPadding = 15; // Allow extra padding in the grow box status bar
		// if using macOS
	}

	jlStatusBar.setBorder(new CompoundBorder(new MatteBorder(1, 0, 0, 0, Color.LIGHT_GRAY), new EmptyBorder(3, 3,
			3, rightPadding)));

	setDefaultStatusBarText();

	if (applicationSettings.getShowStatusBar()) {
		frame.getContentPane().add(jlStatusBar, BorderLayout.SOUTH);
	}
}
 
Example 11
Source Project: openjdk-jdk9   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 12
Source Project: nordpos   Source File: MenuTitleDefinition.java    License: GNU General Public License v3.0 6 votes vote down vote up
public void addComponent(JPanelMenu menu) {
       
//        if (p.x > 20) {
//            p.x = 20;
//            p.y += 55;
//        }
//        p.y += 20; // 20 puntitos extra de separacion.
        
        JLabel lbl = new JLabel(AppLocal.getIntString(KeyText));
        lbl.applyComponentOrientation(menu.getComponentOrientation());
        lbl.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), new Color(0, 0, 0)));
//        lbl.setSize(670, 20);
//        lbl.setLocation(p);
//        p.y += 35;
//        comp.add(lbl);  
        
        menu.addTitle(lbl);
    }
 
Example 13
Source Project: snake-yaml   Source File: MoreImmutablesTest.java    License: Apache License 2.0 6 votes vote down vote up
public void testMatteBorder() {
    DumperOptions options = new DumperOptions();
    options.setWidth(400);
    Yaml yaml = new Yaml(new ImmutablesRepresenter(), options);
    Insets insets = new Insets(10, 20, 30, 40);
    Color color = new Color(100, 150, 200);
    MatteBorder border = BorderFactory.createMatteBorder(insets.top, insets.left,
            insets.bottom, insets.right, color);
    String dump = yaml.dump(border);
    assertEquals(
            "!!javax.swing.border.MatteBorder [!!java.awt.Insets [10, 20, 30, 40], !!java.awt.Color [100, 150, 200, 255]]\n",
            dump);
    Object loaded = yaml.load(dump);
    assertTrue(loaded instanceof MatteBorder);
    MatteBorder loadedBorder = (MatteBorder) loaded;
    assertEquals(insets, loadedBorder.getBorderInsets());
    assertEquals(color, loadedBorder.getMatteColor());
}
 
Example 14
Source Project: jdk-1.7-annotated   Source File: MetaData.java    License: Apache License 2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 15
Source Project: javamoney-examples   Source File: BorderHelper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * This method creates and returns a border.
 *
 * @param title The text displayed on the border.
 * @param showBorder Whether or not to show the outlining of the border.
 *
 * @return A border.
 */
public
static
TitledBorder
createTitledBorder(String title, boolean showBorder)
{
  TitledBorder border = new TitledBorder(title);

  // Build border.
  if(showBorder == true)
  {
      border.setBorder(createEtchedBorder());
  }
  else
  {
    border.setBorder(new MatteBorder(1, 0, 0, 0, GRAY));
  }

  border.setTitleColor(BLACK);
  if (border.getTitleFont() != null) {
  	border.setTitleFont(border.getTitleFont().deriveFont(BOLD, 11.0f));
  }
  return border;
}
 
Example 16
Source Project: openjdk-8-source   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 17
Source Project: jdk8u-jdk   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 18
Source Project: workcraft   Source File: FileCellRenderer.java    License: MIT License 6 votes vote down vote up
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column) {

    chooseButton.setFont(table.getFont());
    chooseButton.setText(null);
    chooseButton.setToolTipText(null);

    if (value instanceof File) {
        File file = (File) value;
        if (file.exists()) {
            chooseButton.setForeground(Color.BLACK);
        } else {
            chooseButton.setForeground(Color.RED);
        }

        chooseButton.setText(file.getPath());
        chooseButton.setToolTipText(file.getAbsolutePath());

        Color background = isSelected ? table.getSelectionBackground() : table.getBackground();
        setBorder(new MatteBorder(0, 0, 0, 0, background));
    }
    return this;
}
 
Example 19
Source Project: visualvm   Source File: BorderBuilders.java    License: GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 20
Source Project: openjdk-8   Source File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
Example 21
Source Project: javamoney-examples   Source File: DayChooser.java    License: Apache License 2.0 5 votes vote down vote up
private
static
JLabel
createWeekdayLabel(String day)
{
  JLabel label = new JLabel(day, SwingConstants.CENTER);

  label.setBorder(new MatteBorder(1, 0, 1, 0, Color.GRAY));
  label.setFont(label.getFont().deriveFont(Font.PLAIN));
  label.setOpaque(true);

  return label;
}
 
Example 22
Source Project: plugins   Source File: ScreenMarkerPanel.java    License: GNU General Public License v3.0 5 votes vote down vote up
private void updateBorder()
{
	if (marker.getMarker().getBorderThickness() == 0)
	{
		borderColorIndicator.setBorder(null);
	}
	else
	{
		Color color = marker.getMarker().getColor();
		borderColorIndicator.setBorder(new MatteBorder(0, 0, 3, 0, color));
	}

	borderColorIndicator.setIcon(marker.getMarker().getBorderThickness() == 0 ? NO_BORDER_COLOR_ICON : BORDER_COLOR_ICON);
}
 
Example 23
Source Project: darklaf   Source File: DarkDesktopIconUI.java    License: MIT License 5 votes vote down vote up
@Override
protected void installComponents() {
    frame = desktopIcon.getInternalFrame();
    Icon icon = frame.getFrameIcon();
    String title = frame.getTitle();

    button = new JButtonUIResource(title, icon);
    button.setOpaque(false);
    button.setFocusable(false);
    button.putClientProperty(DarkButtonUI.KEY_VARIANT, DarkButtonUI.VARIANT_BORDERLESS_RECTANGULAR);
    button.putClientProperty(DarkButtonUI.KEY_HOVER_COLOR, UIManager.getColor("DesktopIcon.hoverColor"));
    button.putClientProperty(DarkButtonUI.KEY_CLICK_COLOR, UIManager.getColor("DesktopIcon.hoverColor"));
    button.setRolloverEnabled(true);
    button.addActionListener(e -> deiconize());
    button.setFont(desktopIcon.getFont());
    button.setBackground(desktopIcon.getBackground());
    button.setForeground(desktopIcon.getForeground());

    labelPad = UIManager.getInt("DesktopIcon.labelPad");

    Icon drag = UIManager.getIcon("DesktopIcon.drag.icon");
    gripLabel = new JLabel(drag);

    gripLabel.setBorder(new MatteBorder(0, 2, 0, 1, desktopIcon.getBackground()));
    desktopIcon.setLayout(new BorderLayout(labelPad, 0));
    desktopIcon.add(button, BorderLayout.CENTER);
    desktopIcon.add(gripLabel, BorderLayout.EAST);
}
 
Example 24
Source Project: Darcula   Source File: DemoSelectorPanel.java    License: Apache License 2.0 5 votes vote down vote up
protected void applyDefaults() {
    
    expandedIcon = new ArrowIcon(ArrowIcon.SOUTH,
            UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
    collapsedIcon = new ArrowIcon(ArrowIcon.EAST,
            UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
    
    setBorder(new MatteBorder(0,0,0,1, 
            UIManager.getColor(SwingSet3.CONTROL_MID_SHADOW_KEY)));
    
    if (titlePanel != null) {
        titlePanel.setGradientColor1(
            UIManager.getColor(SwingSet3.TITLE_GRADIENT_COLOR1_KEY));
        titlePanel.setGradientColor2(
            UIManager.getColor(SwingSet3.TITLE_GRADIENT_COLOR2_KEY));
    }

    if (demoListLabel != null) {
       demoListLabel.setForeground(UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
       demoListLabel.setFont(UIManager.getFont(SwingSet3.TITLE_FONT_KEY));
    }
    if (viewPanel != null) {
        viewPanel.setBackground(UIManager.getColor(SwingSet3.SUB_PANEL_BACKGROUND_KEY));
    }        
    if (collapsePanels != null) {
        for (CollapsiblePanel collapsePanel : collapsePanels) {
            collapsePanel.setFont(
                    UIManager.getFont("CheckBox.font").deriveFont(Font.BOLD));
            collapsePanel.setForeground(UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
            collapsePanel.setExpandedIcon(expandedIcon);
            collapsePanel.setCollapsedIcon(collapsedIcon);
        }
    }
    revalidate();
}
 
Example 25
Source Project: ModTheSpire   Source File: ModPanel.java    License: MIT License 5 votes vote down vote up
public ModPanel(ModInfo info, File modFile, JModPanelCheckBoxList parent) {
    this.info = info;
    this.modFile = modFile;
    checkBox = new JCheckBox();
    setLayout(new BorderLayout());
    infoPanel = new InfoPanel();

    add(checkBox, BorderLayout.WEST);
    add(infoPanel, BorderLayout.CENTER);

    // Update icon
    update.setHorizontalAlignment(JLabel.CENTER);
    update.setVerticalAlignment(JLabel.CENTER);
    update.setOpaque(true);
    update.setBorder(new EmptyBorder(0, 0, 0, 4));
    if (info.isWorkshop) {
        setUpdateIcon(ModSelectWindow.UpdateIconType.WORKSHOP);
    } else if (info.UpdateJSON != null && !info.UpdateJSON.isEmpty()) {
        setUpdateIcon(ModSelectWindow.UpdateIconType.CAN_CHECK);
    } else {
        setUpdateIcon(ModSelectWindow.UpdateIconType.NONE);
    }
    add(update, BorderLayout.EAST);

    setBorder(new MatteBorder(0, 0, 1, 0, Color.darkGray));

    checkBox.addItemListener((event) -> {
        parent.publishBoxChecked();
    });
    parent.publishBoxChecked();
}
 
Example 26
Source Project: ModTheSpire   Source File: ModSelectWindow.java    License: MIT License 5 votes vote down vote up
private JPanel makeStatusPanel()
{
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBorder(new MatteBorder(1, 0, 0, 0, Color.darkGray));

    // StS version
    JLabel sts_version = new JLabel("Slay the Spire version: " + Loader.STS_VERSION);
    if (Loader.STS_BETA) {
        sts_version.setText(sts_version.getText() + " BETA");
    }
    sts_version.setHorizontalAlignment(SwingConstants.RIGHT);
    panel.add(sts_version, BorderLayout.EAST);

    // Debug checkbox
    JCheckBox debugCheck = new JCheckBox(DEBUG_OPTION);
    if (Loader.DEBUG) {
        debugCheck.setSelected(true);
    }
    debugCheck.addActionListener((ActionEvent event) -> {
        Loader.DEBUG = debugCheck.isSelected();
        Loader.MTS_CONFIG.setBool("debug", Loader.DEBUG);
        try {
            Loader.MTS_CONFIG.save();
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
    panel.add(debugCheck, BorderLayout.WEST);

    return panel;
}
 
Example 27
Source Project: littleluck   Source File: DemoSelectorPanel.java    License: Apache License 2.0 5 votes vote down vote up
protected void applyDefaults() {
    
    expandedIcon = new ArrowIcon(ArrowIcon.SOUTH,
            UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
    collapsedIcon = new ArrowIcon(ArrowIcon.EAST,
            UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
    
    setBorder(new MatteBorder(0,0,0,1, 
            UIManager.getColor(SwingSet3.CONTROL_MID_SHADOW_KEY)));
    
    if (titlePanel != null) {
        titlePanel.setGradientColor1(
            UIManager.getColor(SwingSet3.TITLE_GRADIENT_COLOR1_KEY));
        titlePanel.setGradientColor2(
            UIManager.getColor(SwingSet3.TITLE_GRADIENT_COLOR2_KEY));
    }

    if (demoListLabel != null) {
       demoListLabel.setForeground(UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
       demoListLabel.setFont(UIManager.getFont(SwingSet3.TITLE_FONT_KEY));
    }
    if (viewPanel != null) {
        viewPanel.setBackground(UIManager.getColor(SwingSet3.SUB_PANEL_BACKGROUND_KEY));
    }        
    if (collapsePanels != null) {
        for (CollapsiblePanel collapsePanel : collapsePanels) {
            collapsePanel.setFont(
                    UIManager.getFont("CheckBox.font").deriveFont(Font.BOLD));
            collapsePanel.setForeground(UIManager.getColor(SwingSet3.TITLE_FOREGROUND_KEY));
            collapsePanel.setExpandedIcon(expandedIcon);
            collapsePanel.setCollapsedIcon(collapsedIcon);
        }
    }
    revalidate();
}
 
Example 28
Source Project: openjdk-jdk8u   Source File: Test6910490.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 29
Source Project: netbeans   Source File: MatteBorderBeanInfo.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected PropertyDescriptor[] createPropertyDescriptors() throws IntrospectionException {
    return new PropertyDescriptor[] {
        createRO(MatteBorder.class, "borderInsets"), // NOI18N
        createRO(MatteBorder.class, "matteColor"), // NOI18N
        createRO(MatteBorder.class, "tileIcon"), // NOI18N
    };
}
 
Example 30
Source Project: netbeans   Source File: TabContainer.java    License: Apache License 2.0 5 votes vote down vote up
TabContainer( TabbedImpl tabbedImpl, TabDisplayer tabDisplayer, int orientation ) {
    super( new BorderLayout(0, 0) );
    this.tabbedImpl = tabbedImpl;
    this.displayer = tabDisplayer;
    tcPanel = new JPanel( layout );
    add( tcPanel, BorderLayout.CENTER );
    tabbedImpl.getSelectionModel().addChangeListener( this );
    String lafId = UIManager.getLookAndFeel().getID();
    if( "Nimbus".equals( lafId ) ) {
        setBorder( new MatteBorder(1, 1, 1, 1, UIManager.getColor("nimbusBorder"))); //NOI18N
    } else if( "Aqua".equals( lafId ) ) {
        setBorder( BorderFactory.createEmptyBorder() );
    } else {
        setBorder( UIManager.getBorder( "Nb.ScrollPane.border" ) ); //NOI18N
    }
    switch( orientation ) {
        case JTabbedPane.TOP:
            add( displayer, BorderLayout.NORTH );
            break;
        case JTabbedPane.LEFT:
            add( displayer, BorderLayout.WEST );
            break;
        case JTabbedPane.RIGHT:
            add( displayer, BorderLayout.EAST );
            break;
        case JTabbedPane.BOTTOM:
            add( displayer, BorderLayout.SOUTH );
            break;
        default:
            throw new IllegalArgumentException( "Invalid orientation: " + orientation ); //NOI18N
    }
    stateChanged( null );
}