javax.swing.plaf.PanelUI Java Examples

The following examples show how to use javax.swing.plaf.PanelUI. 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 File: PanelPopup.java    From darklaf with 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 File: TabbedPopup.java    From darklaf with 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 File: EndTurnDialog.java    From freecol with 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 File: TradeRouteInputPanel.java    From freecol with 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 File: ScrollableMessagesList.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void setUI(PanelUI ui) {
    preferredSize = null;
    super.setUI(ui);
}
 
Example #6
Source File: BuildQueuePanel.java    From freecol with 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 File: PropertiesPanel.java    From visualvm with 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 File: NavBarPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void setUI(PanelUI ui) {
  getNavBarUI().clearItems();
  super.setUI(ui);
}