javax.swing.OverlayLayout Java Examples

The following examples show how to use javax.swing.OverlayLayout. 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: InformationPanel.java    From stendhal with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new InformationPanel.
 */
InformationPanel() {
	setLayout(new OverlayLayout(this));
	JComponent container = SBoxLayout.createContainer(SBoxLayout.VERTICAL);
	glassPane = new JComponent(){};
	add(glassPane);
	add(container);

	// ** Zone name **
	nameField = new JTextPane();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	nameField.setAlignmentX(CENTER_ALIGNMENT);
	nameField.setOpaque(true);
	nameField.setBackground(getBackground());
	nameField.setForeground(Color.WHITE);
	nameField.setFocusable(false);
	nameField.setEditable(false);
	container.add(nameField, SLayout.EXPAND_X);

	// ** Danger display **
	dangerIndicator = new DangerIndicator(MAX_SKULLS);
	dangerIndicator.setAlignmentX(CENTER_ALIGNMENT);
	container.add(dangerIndicator);
	// Default to safe, so that we always have a tooltip
	describeDanger(0);
}
 
Example #2
Source File: TrackGroup.java    From chipster with MIT License 5 votes vote down vote up
public TrackGroup(GBrowserView view) {
      this.view = view;
      component.setLayout(new GridBagLayout());    
      component.setInheritsPopupMenu(true);
      //Usually track fills the whole track group and listen for these events. 
      //When the height of the settings panel exceeds the height of the tracks, also the 
      //TrackGroup becomes visible and has to listen for events.
      component.addMouseListener(getView());
      component.addMouseMotionListener(getView());
      component.addMouseWheelListener(getView());
      
      component.setBackground(Color.white);     
      
component.setLayout(new OverlayLayout(component));				

trackLayer = new JPanel();
settingsLayer = new JPanel();

trackLayer.setInheritsPopupMenu(true);
settingsLayer.setInheritsPopupMenu(true);

//First component added is the topmost when drawn
component.add(settingsLayer);
component.add(trackLayer); 		

trackLayer.setLayout(new MigLayout("flowy, fillx, gap 0! 0!, insets 0"));
settingsLayer.setLayout(new MigLayout("gap 0! 0!, insets 0"));

settingsLayer.setOpaque(false);		
trackLayer.setBackground(Color.white);			
  }
 
Example #3
Source File: LayeredScrollPane.java    From Carcassonne with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Creates a layered scroll pane and centers it for a certain grid size.
 */
public LayeredScrollPane() {
    layeredPane = new JLayeredPane();
    layeredPane.setLayout(new OverlayLayout(layeredPane));
    setViewportView(layeredPane);
    getVerticalScrollBar().setUnitIncrement(SCROLL_SPEED);
    getHorizontalScrollBar().setUnitIncrement(SCROLL_SPEED);
}
 
Example #4
Source File: ApplicationFrame.java    From filthy-rich-clients with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void addLayeredValidator() {
    validator = new Validator();
    
    JLayeredPane layeredPane = getRootPane().getLayeredPane();
    layeredPane.setLayout(new OverlayLayout(layeredPane));
    layeredPane.add(validator, (Integer) (JLayeredPane.DEFAULT_LAYER + 50));
    //validator.setBounds(0, 0, getWidth(), getHeight());
}
 
Example #5
Source File: LabeledProgressBar.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
public LabeledProgressBar() {

    setLayout(new OverlayLayout(this));

    label = new JLabel();
    label.setAlignmentX(0.5f);
    label.setFont(label.getFont().deriveFont(11f));
    add(label);

    progressBar = new JProgressBar(0, 100);
    progressBar.setBorderPainted(false);
    add(progressBar);

  }
 
Example #6
Source File: CSVFormatSpecificationPanel.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Fills the tablePane with content.
 */
private JComponent makePreviewTable() {
	previewTable = new ExtendedJTable(false, false, false);
	// ensure same background as JPanels in case of only few rows
	previewTable.setBackground(Colors.PANEL_BACKGROUND);
	previewTable.setColoredTableCellRenderer(new ColoredTableCellRenderer() {

		private final Font boldFont = getFont().deriveFont(Font.BOLD);

		@Override
		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
													   int row, int column) {
			JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
			adjustCell(row, label, boldFont);
			return label;
		}

	});

	loadingContentPane = new LoadingContentPane("loading_data", previewTable);

	tablePane = new ExtendedJScrollPane(loadingContentPane);
	tablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
	tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	tablePane.setBorder(null);

	// add PREVIEW label in front of scrollpane
	JLayeredPane layeredPane = new JLayeredPane();
	layeredPane.setLayout(new OverlayLayout(layeredPane));
	layeredPane.add(tablePane, JLayeredPane.DEFAULT_LAYER);

	JPanel overlayPanel = new JPanel(new BorderLayout());
	overlayPanel.setOpaque(false);
	overlayLabel = new JLabel("", SwingConstants.CENTER);
	showPreviewLettering();
	overlayPanel.add(overlayLabel, BorderLayout.CENTER);

	layeredPane.add(overlayPanel, JLayeredPane.PALETTE_LAYER);
	return layeredPane;
}
 
Example #7
Source File: OverlayLayoutSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static Constructor getOverlayLayoutConstructor() {
    if (overlayLayoutConstructor == null) {
        try {
            overlayLayoutConstructor = OverlayLayout.class.getConstructor(
                                       new Class[] { Container.class });
        } catch (NoSuchMethodException ex) { // should not happen
            Exceptions.printStackTrace(ex);
        }
    }
    return overlayLayoutConstructor;
}
 
Example #8
Source File: javax_swing_OverlayLayout.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #9
Source File: javax_swing_OverlayLayout.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #10
Source File: HeaderPanel.java    From visualvm with GNU General Public License v2.0 4 votes vote down vote up
private void initComponents() {
    JTable impl = new JTable(new DefaultTableModel(new Object[] { "" }, 0)); // NOI18N
    TableColumnModel colMod = impl.getColumnModel();
    final TableColumn col = colMod.getColumn(0);
    impl.setFocusable(false);
    header = new Header(colMod);
    impl.setTableHeader(header);
    header.setResizingAllowed(false);
    header.setReorderingAllowed(false);

    final TableCellRenderer renderer = header.getDefaultRenderer();
    header.setDefaultRenderer(new TableCellRenderer() {
        public Component getTableCellRendererComponent(
                JTable table, Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {

            Component component = renderer.getTableCellRendererComponent(
                    table, getRendererValue(), isSelected(),
                    isSelected(), row, processMouseEvents() ? 0 : 1);

            setupRenderer(component);

            col.setWidth(header.getWidth());
            return component;
        }
    });

    JScrollPane scroll = new JScrollPane(impl, JScrollPane.VERTICAL_SCROLLBAR_NEVER,
                                               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) {
        public Dimension getPreferredSize() { return header.getPreferredSize(); }
        public void reshape(int x, int y, int width, int height) {
            header.setPreferredSize(new Dimension(width, height));
            super.reshape(x, y, width, height);
        }
    };
    scroll.setBorder(BorderFactory.createEmptyBorder());
    scroll.setViewportBorder(BorderFactory.createEmptyBorder());

    setLayout(new OverlayLayout(this));
    add(scroll);
}
 
Example #11
Source File: HeaderPanel.java    From visualvm with GNU General Public License v2.0 4 votes vote down vote up
private void initComponents() {
    JTable impl = new JTable(new DefaultTableModel(new Object[] { "" }, 0)); // NOI18N
    TableColumnModel colMod = impl.getColumnModel();
    final TableColumn col = colMod.getColumn(0);
    impl.setFocusable(false);
    header = new Header(colMod);
    impl.setTableHeader(header);
    header.setResizingAllowed(false);
    header.setReorderingAllowed(false);

    final TableCellRenderer renderer = header.getDefaultRenderer();
    header.setDefaultRenderer(new TableCellRenderer() {
        public Component getTableCellRendererComponent(
                JTable table, Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {

            Component component = renderer.getTableCellRendererComponent(
                    table, getRendererValue(), isSelected(),
                    isSelected(), row, processMouseEvents() ? 0 : 1);

            setupRenderer(component);

            col.setWidth(header.getWidth());
            return component;
        }
    });

    JScrollPane scroll = new JScrollPane(impl, JScrollPane.VERTICAL_SCROLLBAR_NEVER,
                                               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) {
        public Dimension getPreferredSize() { return header.getPreferredSize(); }
        public void reshape(int x, int y, int width, int height) {
            header.setPreferredSize(new Dimension(width, height));
            super.reshape(x, y, width, height);
        }
    };
    scroll.setBorder(BorderFactory.createEmptyBorder());
    scroll.setViewportBorder(BorderFactory.createEmptyBorder());

    setLayout(new OverlayLayout(this));
    add(scroll);
}
 
Example #12
Source File: javax_swing_OverlayLayout.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getObject() {
    return new OverlayLayout(new JLabel("TEST"));
}
 
Example #13
Source File: javax_swing_OverlayLayout.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #14
Source File: javax_swing_OverlayLayout.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getObject() {
    return new OverlayLayout(new JLabel("TEST"));
}
 
Example #15
Source File: javax_swing_OverlayLayout.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #16
Source File: PeakStatusCellRenderer.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,
 *      java.lang.Object, boolean, boolean, int, int)
 */
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {

  JPanel newPanel = new JPanel();
  newPanel.setLayout(new OverlayLayout(newPanel));

  Color bgColor;

  if (isSelected)
    bgColor = table.getSelectionBackground();
  else
    bgColor = table.getBackground();

  newPanel.setBackground(bgColor);

  if (hasFocus) {
    Border border = null;
    if (isSelected)
      border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
    if (border == null)
      border = UIManager.getBorder("Table.focusCellHighlightBorder");

    /*
     * The "border.getBorderInsets(newPanel) != null" is a workaround for OpenJDK 1.6.0 bug,
     * otherwise setBorder() may throw a NullPointerException
     */
    if ((border != null) && (border.getBorderInsets(newPanel) != null)) {
      newPanel.setBorder(border);
    }

  }

  if (value != null) {
    FeatureStatus status = (FeatureStatus) value;

    switch (status) {
      case DETECTED:
        newPanel.add(greenCircle);
        break;
      case ESTIMATED:
        newPanel.add(yellowCircle);
        break;
      case MANUAL:
        newPanel.add(orangeCircle);
        break;
      default:
        newPanel.add(redCircle);
        break;
    }

    newPanel.setToolTipText(status.toString());

  } else {
    newPanel.add(redCircle);
  }

  return newPanel;

}
 
Example #17
Source File: ComponentCellRenderer.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,
 *      java.lang.Object, boolean, boolean, int, int)
 */
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {

  JPanel newPanel = new JPanel();
  newPanel.setLayout(new OverlayLayout(newPanel));

  Color bgColor;

  if (isSelected)
    bgColor = table.getSelectionBackground();
  else
    bgColor = table.getBackground();

  newPanel.setBackground(bgColor);

  if (hasFocus) {
    Border border = null;
    if (isSelected)
      border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
    if (border == null)
      border = UIManager.getBorder("Table.focusCellHighlightBorder");
    if (border != null)
      newPanel.setBorder(border);
  }

  if (value != null) {

    if (value instanceof JComponent) {

      newPanel.add((JComponent) value);

    } else {

      JLabel newLabel = new JLabel();
      if (value instanceof IIsotope) {
        IIsotope is = (IIsotope) value;
        newLabel.setText(is.getSymbol());
      } else {
        newLabel.setText(value.toString());
      }

      if (font != null)
        newLabel.setFont(font);
      else if (table.getFont() != null)
        newLabel.setFont(table.getFont());

      newPanel.add(newLabel);
    }

    if (createTooltips)
      newPanel.setToolTipText(value.toString());

  }

  return newPanel;

}
 
Example #18
Source File: ComponentCellRenderer.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList,
 *      java.lang.Object, int, boolean, boolean)
 */
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
    boolean isSelected, boolean hasFocus) {

  JPanel newPanel = new JPanel();
  newPanel.setLayout(new OverlayLayout(newPanel));

  Color bgColor;

  if (isSelected)
    bgColor = list.getSelectionBackground();
  else
    bgColor = list.getBackground();

  newPanel.setBackground(bgColor);

  if (hasFocus) {
    Border border = null;
    if (isSelected)
      border = UIManager.getBorder("List.focusSelectedCellHighlightBorder");
    if (border == null)
      border = UIManager.getBorder("List.focusCellHighlightBorder");
    if (border != null)
      newPanel.setBorder(border);
  }

  if (value != null) {

    if (value instanceof JComponent) {

      newPanel.add((JComponent) value);

    } else {

      JLabel newLabel = new JLabel(value.toString());

      if (font != null)
        newLabel.setFont(font);
      else if (list.getFont() != null)
        newLabel.setFont(list.getFont());

      newPanel.add(newLabel);
    }
  }

  return newPanel;

}
 
Example #19
Source File: javax_swing_OverlayLayout.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getObject() {
    return new OverlayLayout(new JLabel("TEST"));
}
 
Example #20
Source File: javax_swing_OverlayLayout.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #21
Source File: javax_swing_OverlayLayout.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getObject() {
    return new OverlayLayout(new JLabel("TEST"));
}
 
Example #22
Source File: javax_swing_OverlayLayout.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #23
Source File: ArtARDemo.java    From COMP3204 with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public JPanel getComponent(int width, int height) throws IOException {
	final JPanel container = new JPanel();
	container.setSize(width, height);
	container.setPreferredSize(container.getSize());

	final OverlayLayout overlay = new OverlayLayout(container);
	container.setLayout(overlay);

	labelField = new JEditorPane();
	labelField.setOpaque(false);
	labelField.setSize(640 - 50, 480 - 50);
	labelField.setPreferredSize(labelField.getSize());
	labelField.setMaximumSize(labelField.getSize());
	labelField.setContentType("text/html");

	// add a HTMLEditorKit to the editor pane
	final HTMLEditorKit kit = new HTMLEditorKit();
	labelField.setEditorKit(kit);

	final StyleSheet styleSheet = kit.getStyleSheet();
	styleSheet.addRule("body {color:#FF00FF; font-family:courier;}");
	styleSheet.addRule("h1 {font-size: 60pt}");
	styleSheet.addRule("h2 {font-size: 50pt }");

	final Document doc = kit.createDefaultDocument();
	labelField.setDocument(doc);

	// final GridBagConstraints gbc = new GridBagConstraints();
	// gbc.gridy = 1;
	// panel.add(labelField, gbc);
	container.add(labelField);
	// labelField.setAlignmentX(0.5f);
	// labelField.setAlignmentY(0.5f);

	final JPanel panel = super.getComponent(width, height);
	container.add(panel);

	vc.getDisplay().addVideoListener(this);

	isRunning = true;
	new Thread(this).start();

	return container;
}
 
Example #24
Source File: SplashScreen.java    From importer-exporter with Apache License 2.0 4 votes vote down vote up
private void init(int numberOfSteps, int messageX, int messageY, Color messageColor) {
	JPanel content = new JPanel() {
		public boolean isOptimizedDrawingEnabled() {
			return false;
		}
	};
	
	content.setLayout(new OverlayLayout(content));
	content.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
	
	JPanel dynamicContent = new JPanel();
	dynamicContent.setOpaque(false);
	dynamicContent.setLayout(new GridBagLayout());
		
	message = new JLabel();
	message.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 12));
	message.setForeground(messageColor);
	
	progressBar = new JProgressBar();
	progressBar.setPreferredSize(new Dimension(icon.getIconWidth(), 18));
	progressBar.setIndeterminate(false);
	progressBar.setMaximum(numberOfSteps);
	progressBar.setVisible(false);
	
	GridBagConstraints c = GuiUtil.setConstraints(0, 0, 1, 1, GridBagConstraints.HORIZONTAL, 5 + messageY, 5 + messageX, 0, 5);
	c.anchor = GridBagConstraints.NORTH;
	dynamicContent.add(message, c);
	
	c = GuiUtil.setConstraints(0, 1, 1, 1, GridBagConstraints.HORIZONTAL, 5, 5, 5, 5);
	c.anchor = GridBagConstraints.SOUTH;
	dynamicContent.add(progressBar, c);
	
	dynamicContent.setAlignmentX(0f);
	dynamicContent.setAlignmentY(0f);
	content.add(dynamicContent);
	
	JLabel image = new JLabel(icon);
	image.setAlignmentX(0f);
	image.setAlignmentY(0f);
	content.add(image);
	
	add(content, BorderLayout.CENTER);
	
	// center on screen
	Toolkit t = Toolkit.getDefaultToolkit();
	Insets frame_insets = t.getScreenInsets(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
	int frame_insets_x = frame_insets.left + frame_insets.right;
	int frame_insets_y = frame_insets.bottom + frame_insets.top;
	
	Dimension dim = t.getScreenSize();
	int x = (dim.width - icon.getIconWidth() - frame_insets_x) / 2;
	int y = (dim.height - icon.getIconHeight() - frame_insets_y) / 2;		
	setMinimumSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
	setLocation(x, y);
	setAlwaysOnTop(true);
}
 
Example #25
Source File: PeakShapeCellRenderer.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,
 *      java.lang.Object, boolean, boolean, int, int)
 */
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {

  JPanel newPanel = new JPanel();
  newPanel.setLayout(new OverlayLayout(newPanel));

  Color bgColor;

  if (isSelected)
    bgColor = table.getSelectionBackground();
  else
    bgColor = table.getBackground();

  newPanel.setBackground(bgColor);

  if (value instanceof Feature) {

    Feature peak = (Feature) value;
    double maxHeight = 0;

    PeakShapeNormalization norm =
        parameters.getParameter(PeakListTableParameters.peakShapeNormalization).getValue();
    if (norm == null)
      norm = PeakShapeNormalization.ROWMAX;
    switch (norm) {
      case GLOBALMAX:
        maxHeight = peakList.getDataPointMaxIntensity();
        break;
      case ROWMAX:
        int rowNumber = peakList.getPeakRowNum(peak);
        maxHeight = peakList.getRow(rowNumber).getDataPointMaxIntensity();
        break;
      default:
        maxHeight = peak.getRawDataPointsIntensityRange().upperEndpoint();
        break;
    }
    PeakXICComponent xic = new PeakXICComponent(peak, maxHeight);

    // newPanel.add(xic);

    // newPanel.setToolTipText(xic.getToolTipText());

  }

  if (value instanceof PeakListRow) {

    PeakListRow plRow = (PeakListRow) value;

    RawDataFile[] dataFiles = peakList.getRawDataFiles().toArray(RawDataFile[]::new);
    Feature[] peaks = new Feature[dataFiles.length];
    for (int i = 0; i < dataFiles.length; i++) {
      peaks[i] = plRow.getPeak(dataFiles[i]);
    }

    // CombinedXICComponent xic = new CombinedXICComponent(peaks, plRow.getID());

    // newPanel.add(xic);

    // newPanel.setToolTipText(xic.getToolTipText());

  }

  return newPanel;

}
 
Example #26
Source File: PeakStatusCellRenderer.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,
 *      java.lang.Object, boolean, boolean, int, int)
 */
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {

  JPanel newPanel = new JPanel();
  newPanel.setLayout(new OverlayLayout(newPanel));

  Color bgColor;

  if (isSelected)
    bgColor = table.getSelectionBackground();
  else
    bgColor = table.getBackground();

  newPanel.setBackground(bgColor);

  if (hasFocus) {
    Border border = null;
    if (isSelected)
      border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
    if (border == null)
      border = UIManager.getBorder("Table.focusCellHighlightBorder");

    /*
     * The "border.getBorderInsets(newPanel) != null" is a workaround for OpenJDK 1.6.0 bug,
     * otherwise setBorder() may throw a NullPointerException
     */
    if ((border != null) && (border.getBorderInsets(newPanel) != null)) {
      newPanel.setBorder(border);
    }

  }

  if (value != null) {
    FeatureStatus status = (FeatureStatus) value;

    switch (status) {
      case DETECTED:
        newPanel.add(greenCircle);
        break;
      case ESTIMATED:
        newPanel.add(yellowCircle);
        break;
      case MANUAL:
        newPanel.add(orangeCircle);
        break;
      default:
        newPanel.add(redCircle);
        break;
    }

    newPanel.setToolTipText(status.toString());

  } else {
    newPanel.add(redCircle);
  }

  return newPanel;

}
 
Example #27
Source File: javax_swing_OverlayLayout.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getObject() {
    return new OverlayLayout(new JLabel("TEST"));
}
 
Example #28
Source File: javax_swing_OverlayLayout.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}
 
Example #29
Source File: javax_swing_OverlayLayout.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getObject() {
    return new OverlayLayout(new JLabel("TEST"));
}
 
Example #30
Source File: javax_swing_OverlayLayout.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected OverlayLayout getAnotherObject() {
    return null; // TODO: could not update property
    // return new OverlayLayout(new JPanel());
}