Examples of JLabel


Examples of javax.swing.JLabel

    mShowSettingsSeparator = showSettingsSeparator;
    setLayout(new FormLayout("5dlu,pref,10dlu,default:grow,5dlu",
        "pref,5dlu,top:pref,top:pref,top:pref,top:pref,10dlu,pref"));
    CellConstraints cc = new CellConstraints();

    add(new JLabel(mLocalizer.msg("name", "Name")), cc.xy(2, mYCount));
    add(mNameLabel = new JLabel("-"), cc.xy(4, mYCount++));

    add(new JLabel(mLocalizer.msg("version", "Version")), cc
        .xy(2, mYCount));
    add(mVersionLabel = new JLabel("-"), cc.xy(4, mYCount++));

    add(new JLabel(mLocalizer.msg("author", "Author")), cc.xy(2, mYCount));
    add(mAuthorLabel = new JLabel("-"), cc.xy(4, mYCount++));

    add(new JLabel(mLocalizer.msg("description", "Description")), cc.xy(2,
        mYCount));
    add(mDescriptionLabel = new JLabel(), cc.xy(4, mYCount++));

    if (info != null) {
      setPluginInfo(info);
    }
  }
View Full Code Here

Examples of javax.swing.JLabel

    public ContextMenuCellRenderer() {
      mItemSelected = new JCheckBox();
      mItemSelected.setOpaque(false);
      mSelectionWidth = mItemSelected.getPreferredSize().width;

      mItemLabel = new JLabel();
      mItemPanel = new JPanel(new BorderLayout());
      mItemPanel.add(mItemSelected, BorderLayout.WEST);
      mItemPanel.add(mItemLabel, BorderLayout.CENTER);
    }
View Full Code Here

Examples of javax.swing.JLabel

    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
        boolean cellHasFocus) {

      JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

      if (value instanceof SeparatorMenuItem) {
        LineComponent comp = new LineComponent(label.getForeground());
        comp.setBackground(label.getBackground());
        comp.setOpaque(isSelected);
        comp.setPreferredSize(label.getPreferredSize());
        return comp;
      } else if (value instanceof ConfigMenuItem) {
        mItemSelected.setSelected(!mDeactivatedItems.contains(value));

        mItemLabel.setIcon(TVBrowserIcons.preferences(TVBrowserIcons.SIZE_SMALL));
        mItemLabel.setText(value.toString());
        mItemLabel.setForeground(label.getForeground());

        mItemPanel.setBackground(label.getBackground());
        mItemPanel.setOpaque(isSelected);

        return mItemPanel;
      } else if (value instanceof LeaveFullScreenMenuItem) {
        mItemSelected.setSelected(!mDeactivatedItems.contains(value));

        mItemLabel.setIcon(TVBrowserIcons.fullScreen(TVBrowserIcons.SIZE_SMALL));
        mItemLabel.setText(value.toString());
        mItemLabel.setForeground(label.getForeground());

        mItemPanel.setBackground(label.getBackground());
        mItemPanel.setOpaque(isSelected);

        return mItemPanel;
      } else if (value instanceof ContextMenuIf) {
        ContextMenuIf menuIf = (ContextMenuIf) value;
        Program exampleProgram = Plugin.getPluginManager().getExampleProgram();

        // Get the context menu item text
        StringBuilder text = new StringBuilder();
        Icon icon = null;
        // Action[] actionArr = plugin.getContextMenuActions(exampleProgram);
        ActionMenu actionMenu = menuIf.getContextMenuActions(exampleProgram);
        if (actionMenu != null) {
          Action action = actionMenu.getAction();
          if (action != null) {
            text.append((String) action.getValue(Action.NAME));
            icon = (Icon) action.getValue(Action.SMALL_ICON);
            if (icon != null) {
              icon = new FixedSizeIcon(16, 16, icon);
            }
          } else if (menuIf instanceof PluginProxy) {
            text.append(((PluginProxy) menuIf).getInfo().getName());
            icon = ((PluginProxy) menuIf).getMarkIcon();
          } else {
            text.append("unknown");
            icon = null;
          }
        }

        mItemLabel.setIcon(icon);
        mItemLabel.setText(text.toString());
        mItemLabel.setForeground(label.getForeground());

        mItemSelected.setSelected(!mDeactivatedItems.contains(value));

        mItemPanel.setBackground(label.getBackground());
        mItemPanel.setOpaque(isSelected);
        return mItemPanel;
      }

      return label;
View Full Code Here

Examples of javax.swing.JLabel

        "Use big icons"));
    mUseBigIconsCb.setSelected(Settings.propToolbarUseBigIcons.getBoolean());

    CellConstraints cc = new CellConstraints();

    tSetPanel.add(new JLabel(mLocalizer.msg("location", "Location")),cc.xy(1,1));
    tSetPanel.add(mLocationCB,cc.xy(3,1));
    tSetPanel.add(new JLabel(mLocalizer.msg("icons", "Icons")),cc.xy(5,1));
    tSetPanel.add(mShowCB,cc.xy(7,1));
    tSetPanel.add(mUseBigIconsCb,cc.xy(9,1));

    tSetPanel.setBorder(new CompoundBorder(BorderFactory.createMatteBorder(1,
        0, 1, 0, Color.GRAY), BorderFactory.createEmptyBorder(10, 5, 9, 5)));
View Full Code Here

Examples of javax.swing.JLabel

    mFilter = filter;
  }
 
  public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
      boolean cellHasFocus) {
    JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

    if (mChannel == null) {
      mChannel = new ChannelLabel(true, true);
    }

    if (mChannelCounter == null) {
      mChannelCounter = new DuplicateChannelNameCounter(ChannelList.getAvailableChannels());
    }

    mChannel.setShowCountry(mChannelCounter.isDuplicate((Channel)value));
    mChannel.setShowService(mChannelCounter.isDuplicateIncludingCountry((Channel)value));

    if (value instanceof Channel) {
      mChannel.setChannel((Channel) value);
      mChannel.setOpaque(isSelected);
      mChannel.setBackground(label.getBackground());
      mChannel.setForeground(label.getForeground());
      mChannel.setEnabled(mFilter.accept((Channel)value));
     
      return mChannel;
    }
View Full Code Here

Examples of javax.swing.JLabel

    }
  }

  public JPanel getSettingsPanel() {
    final JPanel content = new JPanel(new BorderLayout());
    content.add(new JLabel(mLocalizer.msg("description",
        "This filter accepts programs belonging to the following channels:")),
        BorderLayout.NORTH);

    ArrayList<String> selectedDays = new ArrayList<String>();
View Full Code Here

Examples of javax.swing.JLabel

        .msg("description", "")), cc.xyw(1, currentRow, 5));

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("3dlu"));

    content.add(new JLabel(mLocalizer.msg("from.1", "From today plus")), cc.xy(
        1, currentRow += 2));
    mFromSpinner = new JSpinner(new SpinnerNumberModel(0, 0, 28, 1));
    mFromSpinner.setValue(mStartDays);
    content.add(mFromSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("from.2", "days")), cc.xy(5,
        currentRow));

    layout.appendRow(RowSpec.decode("pref"));

    content.add(new JLabel(mLocalizer.msg("to.1", "Until today plus")), cc.xy(
        1, currentRow += 2));
    mToSpinner = new JSpinner(new SpinnerNumberModel(7, 0, 28, 1));
    mToSpinner.setValue(mEndDays);
    content.add(mToSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("to.2", "days")), cc
        .xy(5, currentRow));

    JPanel centerPanel = new JPanel(new BorderLayout());
    centerPanel.add(content, BorderLayout.NORTH);
    return centerPanel;
View Full Code Here

Examples of javax.swing.JLabel

    JPanel filterPanel = new JPanel(new FormLayout(
        "pref, 3dlu, pref:grow, fill:60dlu, 3dlu, pref, 3dlu, pref:grow, pref",
        "pref, 3dlu, pref"));

    mCountryCB = new JComboBox();
    filterPanel.add(new JLabel(mLocalizer.msg("country", "Country") + ":"), cc
        .xy(1, 1));
    filterPanel.add(mCountryCB, cc.xyw(3, 1, 2));

    mCategoryCB = new JComboBox();
    mCategoryCB.setMaximumRowCount(20);

    filterPanel.add(new JLabel(mLocalizer.msg("category", "Category") + ":"),
        cc.xy(6, 1));
    filterPanel.add(mCategoryCB, cc.xyw(8, 1, 2));

    JPanel namePanel = new JPanel(new BorderLayout());

    namePanel.add(new JLabel(mLocalizer.msg("filterText",
        "With the following Text")
        + ": "), BorderLayout.WEST);

    mChannelName = new JTextField();
    namePanel.add(mChannelName, BorderLayout.CENTER);
View Full Code Here

Examples of javax.swing.JLabel

  private static class ContextMenuCellRenderer extends DefaultListCellRenderer {
    private JLabel mItemLabel;

    public ContextMenuCellRenderer() {
      mItemLabel = new JLabel();
    }
View Full Code Here

Examples of javax.swing.JLabel

    }

    public Component getListCellRendererComponent(JList list, Object value,
        int index, boolean isSelected, boolean cellHasFocus) {

      JLabel label = (JLabel) super.getListCellRendererComponent(list, value,
          index, isSelected, cellHasFocus);

      if (value instanceof ContextMenuIf) {
        ContextMenuIf menuIf = (ContextMenuIf) value;
        Program exampleProgram = Plugin.getPluginManager().getExampleProgram();

        // Get the context menu item text
        StringBuilder text = new StringBuilder();
        Icon icon = null;
        ActionMenu actionMenu = menuIf.getContextMenuActions(exampleProgram);
        if (actionMenu != null) {
          Action action = actionMenu.getAction();
          if (action != null) {
            text.append((String) action.getValue(Action.NAME));
            icon = (Icon) action.getValue(Action.SMALL_ICON);
          } else if (menuIf instanceof PluginProxy) {
            text.append(((PluginProxy) menuIf).getInfo().getName());
            icon = ((PluginProxy) menuIf).getMarkIcon();
          } else {
            text.append("unknown");
            icon = null;
          }
        }

        mItemLabel.setIcon(icon);
        mItemLabel.setForeground(label.getForeground());
        mItemLabel.setBackground(label.getBackground());
        mItemLabel.setText(text.toString());
        mItemLabel.setOpaque(label.isOpaque());

        return mItemLabel;
      }

      return label;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.