javax.swing.JLabel#setIconTextGap ( )源码实例Demo

下面列出了javax.swing.JLabel#setIconTextGap ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lucene-solr   文件: HelpHeaderRenderer.java
@Override
@SuppressWarnings("unchecked")
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  if (table != null && this.table != table) {
    this.table = table;
    final JTableHeader header = table.getTableHeader();
    if (header != null) {
      panel.setLayout(new FlowLayout(FlowLayout.LEADING));
      panel.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
      panel.add(new JLabel(value.toString()));

      // add label with mouse click listener
      // when the label is clicked, help dialog will be displayed.
      JLabel helpLabel = new JLabel(FontUtils.elegantIconHtml("t", MessageUtils.getLocalizedMessage("label.help")));
      helpLabel.setHorizontalAlignment(JLabel.LEFT);
      helpLabel.setIconTextGap(5);
      panel.add(FontUtils.toLinkText(helpLabel));

      // add mouse listener to JTableHeader object.
      // see: https://stackoverflow.com/questions/7137786/how-can-i-put-a-control-in-the-jtableheader-of-a-jtable
      header.addMouseListener(new HelpClickListener(column));
    }
  }
  return panel;
}
 
源代码2 项目: importer-exporter   文件: BoundingBoxValidator.java
private void init() {
	setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
	setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/org/citydb/gui/images/map/map_icon.png")));
	setLayout(new GridBagLayout());
	setBackground(Color.WHITE);	

	messageLabel = new JLabel();
	messageLabel.setIcon(new ImageIcon(getClass().getResource("/org/citydb/gui/images/map/loader.gif")));
	messageLabel.setIconTextGap(10);

	button = new JButton(Language.I18N.getString("common.button.ok"));
	button.setVisible(false);

	add(messageLabel, GuiUtil.setConstraints(0, 0, 1, 0, GridBagConstraints.HORIZONTAL, 10, 10, 10, 10));
	add(button, GuiUtil.setConstraints(0, 1, 0, 0, GridBagConstraints.NONE, 10, 5, 10, 5));

	button.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			dispose();
		}
	});

	pack();
	setLocationRelativeTo(getOwner());
	setResizable(false);
}
 
源代码3 项目: jclic   文件: EditorPanel.java
protected JLabel createTitleLabel(int preferredWidth) {
  JLabel result = new JLabel(getTitle());
  result.setHorizontalAlignment(SwingConstants.CENTER);
  if (getIcon() != null) {
    result.setIcon(getIcon());
    result.setIconTextGap(10);
  }
  result.setBackground(titleBgColor);
  result.setForeground(titleForeColor);
  result.setOpaque(true);
  result.setBorder(titleBorder);
  result.validate();
  Dimension d = result.getPreferredSize();
  result.setPreferredSize(new Dimension(Math.max(d.width, preferredWidth), d.height));
  result.setMinimumSize(result.getPreferredSize());
  return result;
}
 
源代码4 项目: plugins   文件: HiscorePanel.java
private JPanel makeHiscorePanel(HiscoreSkill skill)
{
	HiscoreSkillType skillType = skill == null ? HiscoreSkillType.SKILL : skill.getType();

	JLabel label = new JLabel();
	label.setFont(FontManager.getRunescapeSmallFont());
	label.setText(pad("--", skillType));

	String directory;
	if (skill == null || skill == OVERALL)
	{
		directory = "/skill_icons/";
	}
	else if (skill.getType() == HiscoreSkillType.BOSS)
	{
		directory = "bosses/";
	}
	else
	{
		directory = "/skill_icons_small/";
	}

	String skillName = (skill == null ? "combat" : skill.name().toLowerCase());
	String skillIcon = directory + skillName + ".png";
	log.debug("Loading skill icon from {}", skillIcon);

	label.setIcon(new ImageIcon(ImageUtil.getResourceStreamFromClass(getClass(), skillIcon)));

	boolean totalLabel = skill == HiscoreSkill.OVERALL || skill == null; //overall or combat
	label.setIconTextGap(totalLabel ? 10 : 4);

	JPanel skillPanel = new JPanel();
	skillPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
	skillPanel.setBorder(new EmptyBorder(2, 0, 2, 0));
	skillLabels.put(skill, label);
	skillPanel.add(label);

	return skillPanel;
}
 
源代码5 项目: netbeans   文件: JComponentBuilders.java
protected void setupInstance(JLabel instance) {
    super.setupInstance(instance);
    
    instance.setText(text);
    
    if (defaultIcon != null) instance.setIcon(defaultIcon.createInstance());
    
    instance.setVerticalAlignment(verticalAlignment);
    instance.setHorizontalAlignment(horizontalAlignment);
    instance.setVerticalTextPosition(verticalTextPosition);
    instance.setHorizontalTextPosition(horizontalTextPosition);
    instance.setIconTextGap(iconTextGap);
}
 
public PaneBorder() {
  borderColor = UIManager.getColor("TaskPaneGroup.borderColor");      

  titleForeground = UIManager.getColor("TaskPaneGroup.titleForeground");

  specialTitleBackground = UIManager
    .getColor("TaskPaneGroup.specialTitleBackground");
  specialTitleForeground = UIManager
    .getColor("TaskPaneGroup.specialTitleForeground");

  titleBackgroundGradientStart = UIManager
    .getColor("TaskPaneGroup.titleBackgroundGradientStart");
  titleBackgroundGradientEnd = UIManager
    .getColor("TaskPaneGroup.titleBackgroundGradientEnd");
  
  titleOver = UIManager.getColor("TaskPaneGroup.titleOver");
  if (titleOver == null) {
    titleOver = specialTitleBackground.brighter();
  }
  specialTitleOver = UIManager.getColor("TaskPaneGroup.specialTitleOver");
  if (specialTitleOver == null) {
    specialTitleOver = specialTitleBackground.brighter();
  }
  
  label = new JLabel();
  label.setOpaque(false);
  label.setIconTextGap(8);
}
 
源代码7 项目: visualvm   文件: JComponentBuilders.java
protected void setupInstance(JLabel instance) {
    super.setupInstance(instance);
    
    instance.setText(text);
    
    if (defaultIcon != null) instance.setIcon(defaultIcon.createInstance());
    
    instance.setVerticalAlignment(verticalAlignment);
    instance.setHorizontalAlignment(horizontalAlignment);
    instance.setVerticalTextPosition(verticalTextPosition);
    instance.setHorizontalTextPosition(horizontalTextPosition);
    instance.setIconTextGap(iconTextGap);
}
 
源代码8 项目: visualvm   文件: CategoryList.java
private static Icon centeredIcon(final Icon icon, final int width, final int height) {
    JLabel l = new JLabel(icon);
    l.setIconTextGap(0);
    l.setBorder(null);
    l.setSize(width, height);
    
    BufferedImage img = new BufferedImage(l.getWidth(), l.getHeight(), BufferedImage.TYPE_INT_ARGB);
    l.paint(img.getGraphics());
    
    return new ImageIcon(img);
}
 
源代码9 项目: pumpernickel   文件: ThumbnailLabelUI.java
@Override
public void installUI(JComponent c) {
	super.installUI(c);
	c.addComponentListener(repaintComponentListener);
	JLabel label = (JLabel) c;
	label.setHorizontalTextPosition(SwingConstants.CENTER);
	label.setIconTextGap(3);
}
 
源代码10 项目: runelite   文件: HiscorePanel.java
private JPanel makeHiscorePanel(HiscoreSkill skill)
{
	HiscoreSkillType skillType = skill == null ? HiscoreSkillType.SKILL : skill.getType();

	JLabel label = new JLabel();
	label.setFont(FontManager.getRunescapeSmallFont());
	label.setText(pad("--", skillType));

	String directory;
	if (skill == null || skill == OVERALL)
	{
		directory = "/skill_icons/";
	}
	else if (skill.getType() == HiscoreSkillType.BOSS)
	{
		directory = "bosses/";
	}
	else
	{
		directory = "/skill_icons_small/";
	}

	String skillName = (skill == null ? "combat" : skill.name().toLowerCase());
	String skillIcon = directory + skillName + ".png";
	log.debug("Loading skill icon from {}", skillIcon);

	label.setIcon(new ImageIcon(ImageUtil.getResourceStreamFromClass(getClass(), skillIcon)));

	boolean totalLabel = skill == HiscoreSkill.OVERALL || skill == null; //overall or combat
	label.setIconTextGap(totalLabel ? 10 : 4);

	JPanel skillPanel = new JPanel();
	skillPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
	skillPanel.setBorder(new EmptyBorder(2, 0, 2, 0));
	skillLabels.put(skill, label);
	skillPanel.add(label);

	return skillPanel;
}
 
源代码11 项目: javamelody   文件: JavaInformationsPanel.java
static JLabel toBar(String text, double percentValue) {
	final String tmp = replaceLineFeedWithHtmlBr(text);
	final JLabel label = new JLabel(tmp);
	label.setIconTextGap(10);
	try {
		label.setIcon(new ImageIcon(Bar.toBar(percentValue)));
	} catch (final IOException e) {
		throw new IllegalStateException(e);
	}
	label.setHorizontalTextPosition(SwingConstants.LEFT);
	final double myPercent = Math.max(Math.min(percentValue, 100d), 0d);
	label.setToolTipText(I18N.createPercentFormat().format(myPercent) + '%');
	return label;
}
 
源代码12 项目: jpexs-decompiler   文件: MainPanel.java
private static void addTab(JTabbedPane tabbedPane, Component tab, String title, Icon icon) {
    tabbedPane.add(tab);

    JLabel lbl = new JLabel(title);
    lbl.setIcon(icon);
    lbl.setIconTextGap(5);
    lbl.setHorizontalTextPosition(SwingConstants.RIGHT);

    tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1, lbl);
}
 
源代码13 项目: magarena   文件: CardColorStatsPanel.java
void setStats(CardStatistics stats) {

        lines.clear();
        for (int i = 0; i < stats.colorCount.length; i++) {
            if (stats.colorCount[i] > 0) {
                final MagicColor color = MagicColor.values()[i];
                final JLabel label = new JLabel(MagicImages.getIcon(color.getManaType()));
                label.setHorizontalAlignment(JLabel.LEFT);
                label.setIconTextGap(5);
                label.setText(MText.get(_S4,
                    stats.colorCount[i],
                    stats.colorMono[i],
                    stats.colorLands[i])
                );
                lines.add(label);
            }
        }

        final JLabel allLabel = new JLabel(MText.get(_S3,
            stats.monoColor,
            stats.multiColor,
            stats.colorless)
        );
        allLabel.setFont(allLabel.getFont().deriveFont(Font.ITALIC));
        lines.add(allLabel);

        final JPanel panel = new JPanel(new MigLayout("flowy, insets 4"));
        panel.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.GRAY));
        panel.setOpaque(false);
        for (final JLabel line : lines) {
            panel.add(line, "w 100%");
        }

        removeAll();
        add(DeckStatisticsViewer.getCaptionLabel(MText.get(_S1)), "w 100%");
        add(panel, "w 100%");
        revalidate();
    }
 
源代码14 项目: oim-fx   文件: OnlyMessageBox.java
private void init(String message, OnlyMessageBox.MessageType messageType, int option) {

      iconMap = new HashMap<OnlyMessageBox.MessageType, Icon>();
      iconMap.put(OnlyMessageBox.MessageType.ERROR, new ImageIcon());
      iconMap.put(OnlyMessageBox.MessageType.INFORMATION, new ImageIcon());
      iconMap.put(OnlyMessageBox.MessageType.QUESTION, new ImageIcon());
      iconMap.put(OnlyMessageBox.MessageType.WARNING, new ImageIcon());

      JPanel buttonPane = new JPanel();
      lbMessage = new JLabel(message, iconMap.get(messageType), JLabel.LEFT);
      btnOK = new JButton("确定");
      btnCancel = new JButton("取消");
      btnYes = new JButton("是");
      btnNo = new JButton("否");
      JButton[] buttons = {btnOK, btnYes, btnNo, btnCancel};
      int[] options = {OK_OPTION, YES_OPTION, NO_OPTION, CANCEL_OPTION};
      final Dimension buttonSize = new Dimension(69, 21);
      int index = 0;
      boolean hasDefaultButton = false;

     
      lbMessage.setIconTextGap(16);
      lbMessage.setHorizontalAlignment(JLabel.LEFT);
      lbMessage.setVerticalAlignment(JLabel.TOP);
      lbMessage.setVerticalTextPosition(JLabel.TOP);
      lbMessage.setBorder(new EmptyBorder(15, 25, 15, 25));
      buttonPane.setLayout(new LineLayout(6, 0, 0, 0, 0, LineLayout.LEADING, LineLayout.LEADING, LineLayout.HORIZONTAL));
      buttonPane.setPreferredSize(new Dimension(-1, 33));
      buttonPane.setBorder(new EmptyBorder(5, 9, 0, 9));
      buttonPane.setBackground(new Color(255, 255, 255, 170));

      for (JButton button : buttons) {
          button.setActionCommand(String.valueOf(options[index]));
          button.setPreferredSize(buttonSize);
          button.setVisible((option & options[index]) != 0);
          button.addActionListener(this);
          buttonPane.add(button, LineLayout.END);
          index++;

          if (!hasDefaultButton && button.isVisible()) {
              getRootPane().setDefaultButton(button);
              hasDefaultButton = true;
          }
      }

      getContentPane().setLayout(new LineLayout(0, 1, 1, 3, 1, LineLayout.LEADING, LineLayout.LEADING, LineLayout.VERTICAL));
      getContentPane().add(lbMessage, LineLayout.MIDDLE_FILL);
      getContentPane().add(buttonPane, LineLayout.END_FILL);
  }
 
源代码15 项目: xdm   文件: MainWindow.java
private JPanel createToolbar() {
	JPanel p = new JPanel(new BorderLayout());
	Box toolBox = Box.createHorizontalBox();
	toolBox.add(Box.createRigidArea(new Dimension(scale(20), scale(60))));
	toolBox.setBackground(ColorResource.getTitleColor());
	toolBox.setOpaque(true);

	JButton btn1 = createToolButton("ADD_URL", "tool_add.png");
	btn1.setToolTipText(StringResource.get("MENU_ADD_URL"));
	toolBox.add(btn1);

	toolBox.add(Box.createRigidArea(new Dimension(scale(10), scale(10))));

	JButton btn2 = createToolButton("DELETE", "tool_del.png");
	btn2.setToolTipText(StringResource.get("MENU_DELETE_DWN"));
	toolBox.add(btn2);

	toolBox.add(Box.createRigidArea(new Dimension(scale(10), scale(10))));

	JButton btn3 = createToolButton("PAUSE", "tool_pause.png");
	btn3.setToolTipText(StringResource.get("MENU_PAUSE"));
	toolBox.add(btn3);

	toolBox.add(Box.createRigidArea(new Dimension(scale(10), scale(10))));

	JButton btn4 = createToolButton("RESUME", "tool_resume.png");
	btn4.setToolTipText(StringResource.get("MENU_RESUME"));
	toolBox.add(btn4);

	toolBox.add(Box.createRigidArea(new Dimension(scale(10), scale(10))));

	JButton btn5 = createToolButton("OPTIONS", "tool_settings.png");
	btn5.setToolTipText(StringResource.get("TITLE_SETTINGS"));
	toolBox.add(btn5);

	toolBox.add(Box.createRigidArea(new Dimension(scale(10), scale(10))));

	JButton btn6 = createToolButton("MENU_VIDEO_DWN", "tool_video.png");
	btn6.setToolTipText(StringResource.get("MENU_VIDEO_DWN"));
	toolBox.add(btn6);

	toolBox.add(Box.createRigidArea(new Dimension(scale(10), scale(10))));

	JButton btn7 = createToolButton("MENU_MEDIA_CONVERTER", "tool_convert.png");
	btn7.setToolTipText(StringResource.get("MENU_MEDIA_CONVERTER"));
	toolBox.add(btn7);
	toolBox.add(Box.createHorizontalGlue());

	btnMonitoring = new JLabel(ImageResource.getIcon("on.png", 85, 21));
	// btnMonitoring.setForeground(Color.WHITE);
	btnMonitoring.setIconTextGap(scale(15));
	btnMonitoring.putClientProperty("xdmbutton.norollover", "true");
	// btnMonitoring.setBackground(ColorResource.getTitleColor());
	btnMonitoring.setName("BROWSER_MONITORING");
	btnMonitoring.setText(StringResource.get("BROWSER_MONITORING"));
	btnMonitoring.setHorizontalTextPosition(JButton.LEADING);
	btnMonitoring.setFont(FontResource.getBigFont());

	btnMonitoring
			.setIcon(Config.getInstance().isBrowserMonitoringEnabled() ? ImageResource.getIcon("on.png", 85, 21)
					: ImageResource.getIcon("off.png", 85, 21));

	btnMonitoring.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseReleased(MouseEvent e) {
			toggleMonitoring((JLabel) e.getSource());
		}
	});
	toolBox.add(btnMonitoring);
	toolBox.add(Box.createRigidArea(new Dimension(scale(25), scale(10))));
	p.add(toolBox);
	return p;
}
 
源代码16 项目: netbeans   文件: FeaturesView.java
public FeaturesView(Component defaultView, String buttonString) {
    if (UIUtils.isOracleLookAndFeel()) {
        setOpaque(true);
        setBackground(UIUtils.getProfilerResultsBackground());
    } else {
        setOpaque(false);
    }
    setBorder(BorderFactory.createEmptyBorder());
    setLayout(new BorderLayout(0, 0));
    
    if (defaultView != null) {
        JScrollPane sp = new JScrollPane(defaultView, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) {
            public Dimension getMinimumSize() { return getPreferredSize(); }
        };
        sp.getVerticalScrollBar().setUnitIncrement(20);
        sp.setBorder(null);
        sp.setViewportBorder(null);

        this.defaultView = sp;
        add(this.defaultView, BorderLayout.CENTER);
    } else {
        this.defaultView = null;
    }
    
    if (buttonString != null) {
        hintLabel = new JLabel();
        hintLabel.setIcon(Icons.getIcon(GeneralIcons.INFO));
        hintLabel.setIconTextGap(hintLabel.getIconTextGap() + 1);
        hintLabel.setOpaque(false);
        
        Font font = new JToolTip().getFont();
        
        Color f = hintLabel.getForeground();
        int r = f.getRed() + 70;
        if (r > 255) r = f.getRed() - 70; else r = Math.min(r, 70);
        int g = f.getGreen() + 70;
        if (g > 255) g = f.getRed() - 70; else g = Math.min(g, 70);
        int b = f.getBlue() + 70;
        if (b > 255) b = f.getRed() - 70; else b = Math.min(b, 70);
        hintLabel.setText("<html><body text=\"rgb(" + r + ", " + g + ", " + b + ")\" style=\"font-size: " + //NOI18N
                          (font.getSize()) + "pt; font-family: " + font.getName() + ";\">" + //NOI18N
                          Bundle.FeaturesView_noData("<b>" + buttonString + "</b>") + "</body></html>"); //NOI18N
        
        hintLabel.setSize(hintLabel.getPreferredSize());
        
        Color c = UIUtils.getProfilerResultsBackground();
        hintColor = Utils.checkedColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), 245));
    } else {
        hintColor = null;
    }
}
 
源代码17 项目: visualvm   文件: FeaturesView.java
public FeaturesView(Component defaultView, String buttonString) {
    if (UIUtils.isOracleLookAndFeel()) {
        setOpaque(true);
        setBackground(UIUtils.getProfilerResultsBackground());
    } else {
        setOpaque(false);
    }
    setBorder(BorderFactory.createEmptyBorder());
    setLayout(new BorderLayout(0, 0));
    
    if (defaultView != null) {
        JScrollPane sp = new JScrollPane(defaultView, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) {
            public Dimension getMinimumSize() { return getPreferredSize(); }
        };
        sp.getVerticalScrollBar().setUnitIncrement(20);
        sp.setBorder(null);
        sp.setViewportBorder(null);

        this.defaultView = sp;
        add(this.defaultView, BorderLayout.CENTER);
    } else {
        this.defaultView = null;
    }
    
    if (buttonString != null) {
        hintLabel = new JLabel();
        hintLabel.setIcon(Icons.getIcon(GeneralIcons.INFO));
        hintLabel.setIconTextGap(hintLabel.getIconTextGap() + 1);
        hintLabel.setOpaque(false);
        
        Font font = new JToolTip().getFont();
        
        Color f = hintLabel.getForeground();
        int r = f.getRed() + 70;
        if (r > 255) r = f.getRed() - 70; else r = Math.min(r, 70);
        int g = f.getGreen() + 70;
        if (g > 255) g = f.getRed() - 70; else g = Math.min(g, 70);
        int b = f.getBlue() + 70;
        if (b > 255) b = f.getRed() - 70; else b = Math.min(b, 70);
        hintLabel.setText("<html><body text=\"rgb(" + r + ", " + g + ", " + b + ")\" style=\"font-size: " + //NOI18N
                          (font.getSize()) + "pt; font-family: " + font.getName() + ";\">" + //NOI18N
                          Bundle.FeaturesView_noData("<b>" + buttonString + "</b>") + "</body></html>"); //NOI18N
        
        hintLabel.setSize(hintLabel.getPreferredSize());
        
        Color c = UIUtils.getProfilerResultsBackground();
        hintColor = Utils.checkedColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), 245));
    } else {
        hintColor = null;
    }
}
 
源代码18 项目: visualvm   文件: CategoryList.java
public Category(String caption, String tooltip,
                boolean initialState, Component[] items,
                int index, int categoriesCount) {

    expanded = initialState;

    setOpaque(false);
    setLayout(new BorderLayout());

    headerLabel = new JLabel(caption);
    headerLabel.setForeground(new JMenuItem().getForeground());
    headerLabel.setToolTipText(tooltip);
    headerLabel.setIconTextGap(5);
    headerLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    headerLabel.setBorder(BorderFactory.createEmptyBorder(3, 5, 3, 5));
    headerLabel.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            expanded = !expanded;
            updateState();
        }
    });
    
    JMenuBar menuBar = new JMenuBar();
    menuBar.setBorder(BorderFactory.createEmptyBorder());
    menuBar.setBorderPainted(false);
    menuBar.setLayout(new BorderLayout());
    menuBar.add(headerLabel, BorderLayout.CENTER);
    
    itemsContainer = new JPanel() {
        public void setEnabled(boolean enabled) {
            Component[] components = getComponents();
            for (Component c : components) c.setEnabled(enabled);
        }
    };
    itemsContainer.setOpaque(false);
    itemsContainer.setLayout(new VerticalLayout(false));

    for (int i = 0; i < items.length; i++)
        itemsContainer.add(items[i]);

    add(menuBar, BorderLayout.NORTH);
    add(itemsContainer, BorderLayout.CENTER);

    updateState();

}
 
源代码19 项目: rtg-tools   文件: RocPlot.java
/**
 * Creates a new swing plot.
 * @param precisionRecall true defaults to precision recall graph
 * @param interpolate if true, enable curve interpolation
 */
RocPlot(boolean precisionRecall, boolean interpolate) {
  mInterpolate = interpolate;
  mMainPanel = new JPanel();
  UIManager.put("FileChooser.readOnly", Boolean.TRUE);
  mFileChooser = new JFileChooser();
  final Action details = mFileChooser.getActionMap().get("viewTypeDetails");
  if (details != null) {
    details.actionPerformed(null);
  }
  mFileChooser.setMultiSelectionEnabled(true);
  mFileChooser.setFileFilter(new RocFileFilter());
  mZoomPP = new RocZoomPlotPanel();
  mZoomPP.setOriginIsMin(true);
  mZoomPP.setTextAntialiasing(true);
  mProgressBar = new JProgressBar(-1, -1);
  mProgressBar.setVisible(true);
  mProgressBar.setStringPainted(true);
  mProgressBar.setIndeterminate(true);
  mStatusLabel = new JLabel();
  mPopup = new JPopupMenu();
  mRocLinesPanel = new RocLinesPanel(this);
  mScrollPane = new JScrollPane(mRocLinesPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  mScrollPane.setWheelScrollingEnabled(true);
  mLineWidthSlider = new JSlider(JSlider.HORIZONTAL, LINE_WIDTH_MIN, LINE_WIDTH_MAX, 1);
  mScoreCB = new JCheckBox("Show Scores");
  mScoreCB.setSelected(true);
  mSelectAllCB = new JCheckBox("Select / Deselect all");
  mTitleEntry = new JTextField("ROC");
  mTitleEntry.setMaximumSize(new Dimension(Integer.MAX_VALUE, mTitleEntry.getPreferredSize().height));
  mOpenButton = new JButton("Open...");
  mOpenButton.setToolTipText("Add a new curve from a file");
  mCommandButton = new JButton("Cmd...");
  mCommandButton.setToolTipText("Send the equivalent rocplot command-line to the terminal");
  final ImageIcon icon = createImageIcon("com/rtg/graph/resources/realtimegenomics_logo.png", "RTG Logo");
  mIconLabel = new JLabel(icon);
  mIconLabel.setBackground(new Color(16, 159, 205));
  mIconLabel.setForeground(Color.WHITE);
  mIconLabel.setOpaque(true);
  mIconLabel.setFont(new Font("Arial", Font.BOLD, 24));
  mIconLabel.setHorizontalAlignment(JLabel.LEFT);
  mIconLabel.setIconTextGap(50);
  if (icon != null) {
    mIconLabel.setMinimumSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
  }
  mGraphType = new JComboBox<>(new String[] {ROC_PLOT, PRECISION_SENSITIVITY});
  mGraphType.setSelectedItem(precisionRecall ? PRECISION_SENSITIVITY : ROC_PLOT);
  configureUI();
}
 
源代码20 项目: importer-exporter   文件: BoundingBoxValidator.java
private void addBoundingBox() {
	JPanel bboxPanel = new JPanel();
	bboxPanel.setLayout(new GridBagLayout());

	JLabel title = new JLabel(Language.I18N.getString("map.boundingBox.label"));
	title.setFont(title.getFont().deriveFont(Font.BOLD));
	title.setIcon(new ImageIcon(getClass().getResource("/org/citydb/gui/images/map/selection.png")));
	title.setIconTextGap(5);

	JLabel lowerLabel = new JLabel("Xmin / Ymin");
	JLabel upperLabel = new JLabel("Xmax / Ymax");

	JLabel lower = new JLabel(String.valueOf(bbox.getLowerCorner().getX()) + " / " + String.valueOf(bbox.getLowerCorner().getY()));
	JLabel upper = new JLabel(String.valueOf(bbox.getUpperCorner().getX()) + " / " + String.valueOf(bbox.getUpperCorner().getY()));

	bboxPanel.add(title, GuiUtil.setConstraints(0,0,0.0,0.0,GridBagConstraints.HORIZONTAL,0,2,0,5));
	bboxPanel.add(new JSeparator(JSeparator.HORIZONTAL), GuiUtil.setConstraints(1,0,1.0,0.0,GridBagConstraints.HORIZONTAL,0,10,0,5));

	GridBagConstraints c = GuiUtil.setConstraints(0,1,0.0,0.0,GridBagConstraints.NONE,5,5,0,5);
	c.anchor = GridBagConstraints.EAST;			
	bboxPanel.add(lowerLabel, c);
	bboxPanel.add(lower, GuiUtil.setConstraints(1,1,1.0,0.0,GridBagConstraints.HORIZONTAL,5,20,0,5));

	c = GuiUtil.setConstraints(0,2,0.0,0.0,GridBagConstraints.NONE,5,5,0,5);
	c.anchor = GridBagConstraints.EAST;
	bboxPanel.add(upperLabel, c);
	bboxPanel.add(upper, GuiUtil.setConstraints(1,2,1.0,0.0,GridBagConstraints.HORIZONTAL,5,20,0,5));

	if (bbox.isSetSrs()) {
		String sridText = bbox.getSrs().getSrid() != 0 ? String.valueOf(bbox.getSrs().getSrid()) : "n/a";
		JLabel description = new JLabel(bbox.getSrs().getDescription());
		JLabel srid = new JLabel(sridText);

		c = GuiUtil.setConstraints(0,3,0.0,0.0,GridBagConstraints.NONE,5,5,0,5);
		c.anchor = GridBagConstraints.EAST;
		bboxPanel.add(new JLabel(Language.I18N.getString("pref.db.srs.label.description")), c);				
		bboxPanel.add(description, GuiUtil.setConstraints(1,3,1.0,0.0,GridBagConstraints.HORIZONTAL,5,20,0,5));

		c = GuiUtil.setConstraints(0,4,0.0,0.0,GridBagConstraints.NONE,5,5,0,5);
		c.anchor = GridBagConstraints.EAST;
		bboxPanel.add(new JLabel(Language.I18N.getString("pref.db.srs.label.srid")), c);
		bboxPanel.add(srid, GuiUtil.setConstraints(1,4,1.0,0.0,GridBagConstraints.HORIZONTAL,5,20,0,5));
	}

	add(bboxPanel, GuiUtil.setConstraints(0, row++, 1, 0, GridBagConstraints.BOTH, 5, 5, 5, 5));
}