Java Code Examples for javax.swing.plaf.PanelUI

The following examples show how to use javax.swing.plaf.PanelUI. 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: darklaf   Source File: PanelPopup.java    License: MIT License 5 votes vote down vote up
@Override
public void setUI(final PanelUI ui) {
    if (!(ui instanceof TabFramePopupUI)) {
        throw new IllegalArgumentException("Ui needs to be of type " + TabFramePopup.class);
    }
    super.setUI(ui);
}
 
Example 2
Source Project: darklaf   Source File: TabbedPopup.java    License: MIT License 5 votes vote down vote up
@Override
public void setUI(final PanelUI ui) {
    if (!(ui instanceof TabFrameTabbedPopupUI)) {
        throw new IllegalArgumentException("Ui needs to be of type " + TabFrameTabbedPopupUI.class);
    }
    super.setUI(ui);
}
 
Example 3
Source Project: freecol   Source File: EndTurnDialog.java    License: GNU General Public License v2.0 5 votes vote down vote up
public UnitCellRenderer() {
    itemPanel.setOpaque(false);
    selectedPanel.setOpaque(false);
    selectedPanel.setUI((PanelUI)FreeColSelectedPanelUI.createUI(selectedPanel));
    locationLabel.setFont(locationLabel.getFont()
        .deriveFont(Font.ITALIC));
}
 
Example 4
Source Project: freecol   Source File: TradeRouteInputPanel.java    License: GNU General Public License v2.0 5 votes vote down vote up
public StopRenderer() {
    NORMAL_COMPONENT.setLayout(new MigLayout("", "[80, center][]"));
    NORMAL_COMPONENT.setOpaque(false);
    SELECTED_COMPONENT.setLayout(new MigLayout("", "[80, center][]"));
    SELECTED_COMPONENT.setOpaque(false);
    SELECTED_COMPONENT.setUI((PanelUI)FreeColSelectedPanelUI
        .createUI(SELECTED_COMPONENT));
}
 
Example 5
Source Project: netbeans   Source File: ScrollableMessagesList.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setUI(PanelUI ui) {
    preferredSize = null;
    super.setUI(ui);
}
 
Example 6
Source Project: freecol   Source File: BuildQueuePanel.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Component getListCellRendererComponent(JList<? extends BuildableType> list,
                                              BuildableType value,
                                              int index,
                                              boolean isSelected,
                                              boolean cellHasFocus) {
    final ImageLibrary lib = getImageLibrary();
    JPanel panel = new MigPanel(new MigLayout());
    panel.setOpaque(false);
    if (isSelected) {
        panel.setUI((PanelUI)FreeColSelectedPanelUI.createUI(panel));
    }

    JLabel imageLabel = new JLabel(new ImageIcon(ImageLibrary
            .getBuildableTypeImage(value, buildingDimension)));
    JLabel nameLabel = new JLabel(Messages.getName(value));
    String reason = lockReasons.get(value);
    panel.add(imageLabel, "span 1 2");
    if (reason == null) {
        panel.add(nameLabel, "wrap");
    } else {
        panel.add(nameLabel, "split 2");
        panel.add(lib.getLockLabel(), "wrap");
        panel.setToolTipText(reason);
    }

    List<AbstractGoods> required = value.getRequiredGoodsList();
    int size = required.size();
    for (int i = 0; i < size; i++) {
        AbstractGoods goods = required.get(i);
        ImageIcon icon = new ImageIcon(lib.getSmallGoodsTypeImage(goods.getType()));
        JLabel goodsLabel = new JLabel(Integer.toString(goods.getAmount()), icon, SwingConstants.CENTER);
        if (i == 0 && size > 1) {
            panel.add(goodsLabel, "split " + size);
        } else {
            panel.add(goodsLabel);
        }
    }
    return panel;
}
 
Example 7
Source Project: visualvm   Source File: PropertiesPanel.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setUI(PanelUI ui) {
    super.setUI(ui);
    setOpaque(false);
}
 
Example 8
Source Project: consulo   Source File: NavBarPanel.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setUI(PanelUI ui) {
  getNavBarUI().clearItems();
  super.setUI(ui);
}