javax.swing.border.BevelBorder Java Examples

The following examples show how to use javax.swing.border.BevelBorder. 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: MainPanel.java    From java-swing-tips with MIT License 6 votes vote down vote up
private MainPanel() {
  super(new BorderLayout());
  JButton button1 = makeButton("Default BevelBorder", new BevelBorder(BevelBorder.RAISED) {
    @Override public Insets getBorderInsets(Component c, Insets insets) {
      insets.set(10, 10, 10, 10);
      return insets;
    }
  });
  JButton button2 = makeButton("Custom BevelBorder", new CustomBevelBorder(BevelBorder.RAISED));

  JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 20));
  p.setBorder(BorderFactory.createEmptyBorder(20, 50, 20, 50));
  p.add(button1);
  p.add(button2);

  add(p);
  EventQueue.invokeLater(() -> SwingUtilities.updateComponentTreeUI(p));
  setPreferredSize(new Dimension(320, 240));
}
 
Example #2
Source File: StyleFactory.java    From stendhal with GNU General Public License v2.0 6 votes vote down vote up
@Override
Style create() {
	Color highlight = new Color(50, 50, 50); // Dark Grey (also text shadow)
	Color shadow = new Color(175, 175, 175); // Light rey (also inactive text color)
	PixmapStyle style = new PixmapStyle("data/gui/paneldrock048.jpg",
			false, highlight, shadow, Color.white, Color.white);
	Color bhighout = new Color(130, 130, 130);
	Color bhighin = new Color(100, 100, 100);
	Color bshadow = new Color(20, 20, 20);

	style.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
			bhighout, bhighin, highlight, bshadow));
	style.setBorderDown(BorderFactory.createBevelBorder(BevelBorder.LOWERED,
			bhighout, bhighin, highlight, bshadow));
	return style;
}
 
Example #3
Source File: ProgramTreePlugin.java    From ghidra with Apache License 2.0 6 votes vote down vote up
/**
 * Method called when the "Open Tree View" icon is hit; creates a window
 * relative to the event source (in this case, a button) and shows the list
 * of trees currently in the Program.
 */
private void openView(Object sourceObject) {
	JButton button = sourceObject instanceof JButton ? (JButton) sourceObject : null;
	final String[] treeNames = currentProgram.getListing().getTreeNames();
	popup = new JPopupMenu("Tree Views");
	for (int i = 0; i < treeNames.length; i++) {
		JMenuItem item = new JMenuItem(treeNames[i]);
		final int index = i;
		item.addActionListener(ev -> openView(treeNames[index]));
		popup.add(item);
	}

	if (treeNames.length == 0) {
		// should not get into this state...
		getTool().setStatusInfo("No views exist.");
	}
	else {
		popup.setBorder(new BevelBorder(BevelBorder.RAISED));
		if (button != null) {
			popup.show(button, button.getX() - button.getWidth(), button.getY());
		}
	}
}
 
Example #4
Source File: ToggleProfilingPointAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initComponents() {
    setLayout(new BorderLayout());

    previewPanel = new JPanel(new FlowLayout(0, 0, FlowLayout.LEADING));
    previewPanel.setBorder(BorderFactory.createEmptyBorder(4, 7, 2, 7));

    label = new JLabel();
    label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2, 7, 7, 7),
                                                       new ThinBevelBorder(BevelBorder.LOWERED)));
    label.setBorder(BorderFactory.createCompoundBorder(label.getBorder(), BorderFactory.createEmptyBorder(4, 3, 4, 3)));
    label.setFont(label.getFont().deriveFont(Font.BOLD));

    JPanel p = new JPanel(new BorderLayout());
    p.setBorder(BorderFactory.createRaisedBevelBorder());
    p.add(previewPanel, BorderLayout.NORTH);
    p.add(label, BorderLayout.CENTER);

    add(p, BorderLayout.CENTER);
}
 
Example #5
Source File: BorderBuilders.java    From netbeans with Apache License 2.0 6 votes vote down vote up
static BorderBuilder fromField(Instance instance, String field, boolean uiresource, Heap heap) {
    Object _border = instance.getValueOfField(field);
    if (!(_border instanceof Instance)) return null;

    Instance border = (Instance)_border;

    // Make sure subclasses are listed before base class if using isSubclassOf
    if (DetailsUtils.isSubclassOf(border, BevelBorder.class.getName())) {
        return new BevelBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, MatteBorder.class.getName())) { // Must be before EmptyBorder (extends EmptyBorder)
        return new EmptyBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EmptyBorder.class.getName())) {
        return new MatteBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EtchedBorder.class.getName())) {
        return new EtchedBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, LineBorder.class.getName())) {
        return new LineBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, TitledBorder.class.getName())) {
        return new TitledBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, CompoundBorder.class.getName())) {
        return new CompoundBorderBuilder(border, heap);
    }

    return null;
}
 
Example #6
Source File: CommanderPanel.java    From consulo with Apache License 2.0 6 votes vote down vote up
public final void setActive(final boolean active) {
  myActive = active;
  if (active) {
    myTitlePanel.setBackground(DARK_BLUE);
    myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED, DARK_BLUE_BRIGHTER, DARK_BLUE_DARKER));
    myParentTitle.setForeground(Color.white);
  }
  else {
    final Color color = UIUtil.getPanelBackground();
    LOG.assertTrue(color != null);
    myTitlePanel.setBackground(color);
    myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, color.brighter(), color.darker()));
    myParentTitle.setForeground(JBColor.foreground());
  }
  final int[] selectedIndices = myList.getSelectedIndices();
  if (selectedIndices.length == 0 && myList.getModel().getSize() > 0) {
    myList.setSelectedIndex(0);
    if (!myList.hasFocus()) {
      IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(myList);
    }
  }
  else if (myList.getModel().getSize() > 0) {
    // need this to generate SelectionChanged events so that listeners, added by Commander, will be notified
    myList.setSelectedIndices(selectedIndices);
  }
}
 
Example #7
Source File: StyleFactory.java    From stendhal with GNU General Public License v2.0 6 votes vote down vote up
@Override
Style create() {
	// Text
	Color highlight = new Color(219, 191, 130);
	Color shadow = new Color(36, 14, 0); // Light brown (also inactive text)
	PixmapStyle style = new PixmapStyle("data/gui/panel_brick_brown_001.png",
			false, highlight, shadow, Color.white, Color.white);
	// Border
	Color blightin = new Color(181, 140, 50);
	Color bshadowin = new Color(98, 47, 15);
	style.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
			highlight, blightin, shadow, bshadowin));
	style.setBorderDown(BorderFactory.createBevelBorder(BevelBorder.LOWERED,
			highlight, blightin, shadow, bshadowin));
	return style;
}
 
Example #8
Source File: BorderBuilders.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
static BorderBuilder fromField(Instance instance, String field, boolean uiresource, Heap heap) {
    Object _border = instance.getValueOfField(field);
    if (!(_border instanceof Instance)) return null;

    Instance border = (Instance)_border;

    // Make sure subclasses are listed before base class if using isSubclassOf
    if (DetailsUtils.isSubclassOf(border, BevelBorder.class.getName())) {
        return new BevelBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, MatteBorder.class.getName())) { // Must be before EmptyBorder (extends EmptyBorder)
        return new EmptyBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EmptyBorder.class.getName())) {
        return new MatteBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EtchedBorder.class.getName())) {
        return new EtchedBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, LineBorder.class.getName())) {
        return new LineBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, TitledBorder.class.getName())) {
        return new TitledBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, CompoundBorder.class.getName())) {
        return new CompoundBorderBuilder(border, heap);
    }

    return null;
}
 
Example #9
Source File: RevokedCertsTableHeadRend.java    From portecle with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the rendered header cell for the supplied value and column.
 *
 * @param jtRevokedCerts The JTable
 * @param value The value to assign to the cell
 * @param bIsSelected True if cell is selected
 * @param iRow The row of the cell to render
 * @param iCol The column of the cell to render
 * @param bHasFocus If true, render cell appropriately
 * @return The rendered cell
 */
@Override
public Component getTableCellRendererComponent(JTable jtRevokedCerts, Object value, boolean bIsSelected,
    boolean bHasFocus, int iRow, int iCol)
{
	// Get header renderer
	JLabel header = (JLabel) jtRevokedCerts.getColumnModel().getColumn(iCol).getHeaderRenderer();

	// The headers contain text
	header.setText(value.toString());
	header.setHorizontalAlignment(LEFT);

	// Set tool tips
	if (iCol == 0)
	{
		header.setToolTipText(RB.getString("RevokedCertsTableHeadRend.SerialNumberColumn.tooltip"));
	}
	else
	{
		header.setToolTipText(RB.getString("RevokedCertsTableHeadRend.RevocationDateColumn.tooltip"));
	}

	header.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new EmptyBorder(0, 5, 0, 5)));

	return header;
}
 
Example #10
Source File: testtable.java    From Hospital-Management-System with MIT License 6 votes vote down vote up
private void initializeUI() {
    setSize(400, 400);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLayout(new BorderLayout(15, 15));

    JPanel top = new JPanel();
    top.setBorder(new LineBorder(Color.RED, 1, true));

    JPanel bottom = new JPanel();
    bottom.setBorder(new BevelBorder(BevelBorder.LOWERED));

    JPanel left = new JPanel();
    left.setBorder(new EtchedBorder(EtchedBorder.RAISED));

    JPanel right = new JPanel();
    right.setBorder(new MatteBorder(5, 5, 5, 5, Color.BLUE));

    JPanel center = new JPanel();
    center.setBorder(new BevelBorder(BevelBorder.RAISED));

    getContentPane().add(top, BorderLayout.NORTH);
    getContentPane().add(bottom, BorderLayout.SOUTH);
    getContentPane().add(left, BorderLayout.WEST);
    getContentPane().add(right, BorderLayout.EAST);
    getContentPane().add(center, BorderLayout.CENTER);
}
 
Example #11
Source File: SystemPropertiesTableHeadRend.java    From portecle with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the rendered header cell for the supplied value and column.
 *
 * @param jtSystemProperties The JTable
 * @param value The value to assign to the cell
 * @param bIsSelected True if cell is selected
 * @param iRow The row of the cell to render
 * @param iCol The column of the cell to render
 * @param bHasFocus If true, render cell appropriately
 * @return The rendered cell
 */
@Override
public Component getTableCellRendererComponent(JTable jtSystemProperties, Object value, boolean bIsSelected,
    boolean bHasFocus, int iRow, int iCol)
{
	// Get header renderer
	JLabel header = (JLabel) jtSystemProperties.getColumnModel().getColumn(iCol).getHeaderRenderer();

	// The headers contain left-aligned text
	header.setText(value.toString());
	header.setHorizontalAlignment(LEFT);

	header.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new EmptyBorder(0, 5, 0, 5)));

	return header;
}
 
Example #12
Source File: StyleFactory.java    From stendhal with GNU General Public License v2.0 6 votes vote down vote up
@Override
Style create() {
	// Font
	Color foreground = new Color(42, 18, 0); // Brown
	Color highlight = new Color(142, 90, 0); // Light brown (also text shadow)
	PixmapStyle style = new PixmapStyle("data/gui/panel_honeycomb_001.png",
			false, highlight, Color.white, Color.white, foreground);

	// Border
	Color blightout = new Color(255, 255, 180);
	Color blightin = new Color(202, 202, 101);
	Color bshadowin = new Color(160, 128, 32);
	Color bshadowout = new Color(86, 69, 17);
	style.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
			blightout, blightin, bshadowout, bshadowin));
	style.setBorderDown(BorderFactory.createBevelBorder(BevelBorder.LOWERED,
			blightout, blightin, bshadowin, bshadowout));
	return style;
}
 
Example #13
Source File: PropertiesDialog.java    From collect-earth with MIT License 6 votes vote down vote up
private JPanel getSqlLitePanel() {
	final JPanel panel = new JPanel(new GridBagLayout());
	final GridBagConstraints constraints = new GridBagConstraints();
	constraints.gridx = 0;
	constraints.gridy = 0;
	constraints.anchor = GridBagConstraints.LINE_START;
	constraints.insets = new Insets(5, 5, 5, 5);
	constraints.weightx = 1.0;
	constraints.fill = GridBagConstraints.HORIZONTAL;

	final Border border = new TitledBorder(new BevelBorder(BevelBorder.RAISED),
			Messages.getString("OptionWizard.30")); //$NON-NLS-1$
	panel.setBorder(border);

	panel.add(propertyToComponent.get(EarthProperty.AUTOMATIC_BACKUP)[0], constraints);
	constraints.gridx++;
	panel.add(getOpenBackupFolderButton());
	return panel;
}
 
Example #14
Source File: DropDownTextField.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void createMatchingWindow() {
	Window parentWindow = WindowUtilities.windowForComponent(this);

	if (parentWindow == null) {
		// maybe we are in a transition phase?
		return;
	}

	// We need to know when to change the size and location of our window.  We call remove
	// first, in case we've already added the listener before
	parentWindow.removeComponentListener(parentWindowListener);
	parentWindow.addComponentListener(parentWindowListener);

	matchingWindow = new JWindow(parentWindow);
	matchingWindow.setFocusable(false);
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBorder(
		BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.GRAY, Color.BLACK));
	scrollPane.setFocusable(false);
	scrollPane.getVerticalScrollBar().setFocusable(false);
	scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	scrollPane.getViewport().add(list);

	matchingWindow.getContentPane().add(scrollPane);
	matchingWindow.setSize(MIN_WIDTH, matchingWindowHeight);

	addUpdateListeners();

	createToolTipWindow(parentWindow);
}
 
Example #15
Source File: AbstractTextFilter.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private JComponent createComponent(String filterName) {
	final JPanel panel = new JPanel(new BorderLayout());
	Border paddingBorder = BorderFactory.createEmptyBorder(1, 5, 1, 5);
	Border outsideBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED);
	panel.setBorder(BorderFactory.createCompoundBorder(outsideBorder, paddingBorder));

	DefaultFormatterFactory factory = new DefaultFormatterFactory(new DefaultFormatter());
	textField = new FilterFormattedTextField(factory, defaultValue);
	textField.setName(filterName + " Field"); // for debugging 	
	textField.setColumns(20);
	textField.setMinimumSize(textField.getPreferredSize());

	// we handle updates in real time, so ignore focus events, which trigger excess filtering
	textField.disableFocusEventProcessing();

	JLabel label = new GDLabel(filterName + ": ");
	panel.add(label, BorderLayout.WEST);
	panel.add(textField, BorderLayout.CENTER);

	StatusLabel nameFieldStatusLabel = new StatusLabel(textField, defaultValue);
	textField.addFilterStatusListener(nameFieldStatusLabel);
	textField.addFilterStatusListener(status -> fireStatusChanged(status));

	final JLayeredPane layeredPane = new JLayeredPane();
	layeredPane.add(panel, BASE_COMPONENT_LAYER);
	layeredPane.add(nameFieldStatusLabel, HOVER_COMPONENT_LAYER);

	layeredPane.setPreferredSize(panel.getPreferredSize());
	layeredPane.addComponentListener(new ComponentAdapter() {
		@Override
		public void componentResized(java.awt.event.ComponentEvent e) {
			Dimension preferredSize = layeredPane.getSize();
			panel.setBounds(0, 0, preferredSize.width, preferredSize.height);
			panel.validate();
		}
	});

	return layeredPane;
}
 
Example #16
Source File: OuterSplitPane.java    From Cafebabe with GNU General Public License v3.0 5 votes vote down vote up
public OuterSplitPane(Component left, Component right) {
	super(JSplitPane.HORIZONTAL_SPLIT, left, right);

	this.setBorder(new BevelBorder(BevelBorder.LOWERED));
	this.setPreferredSize(new Dimension(this.getWidth(), 24));
	this.setDividerLocation((int) (Cafebabe.gui.getSize().getWidth() / 3.5));
}
 
Example #17
Source File: DefaultGTreeFilterProvider.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private JPanel createFilterPanel() {
	JPanel newFilterPanel = new JPanel(new BorderLayout());
	newFilterPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
	JLabel filterLabel = new GLabel(" Filter: ");
	newFilterPanel.add(filterLabel, BorderLayout.WEST);

	filterField = new FilterTextField(gTree.getJTree());
	newFilterPanel.add(filterField, BorderLayout.CENTER);
	filterField.addFilterListener(filterListener);

	filterStateButton = new EmptyBorderButton(filterFactory.getFilterStateIcon());
	filterStateButton.addActionListener(e -> {
		FilterOptionsEditorDialog dialog =
			new FilterOptionsEditorDialog(filterFactory.getFilterOptions());
		DockingWindowManager.showDialog(filterPanel, dialog);
		FilterOptions newFilterOptions = dialog.getResultFilterOptions();
		if (newFilterOptions != null) {
			filterFactory = new GTreeFilterFactory(newFilterOptions);

			filterStateButton.setIcon(newFilterOptions.getFilterStateIcon());
			filterStateButton.setToolTipText(newFilterOptions.getFilterDescription());

			saveFilterState();
			updateModelFilter();
		}
	});

	HelpService helpService = DockingWindowManager.getHelpService();
	HelpLocation helpLocation = new HelpLocation("Trees", "Filters");
	helpService.registerHelp(filterStateButton, helpLocation);
	helpService.registerHelp(filterLabel, helpLocation);
	helpService.registerHelp(filterField, helpLocation);

	filterStateButton.setToolTipText("Filter Options");
	newFilterPanel.add(filterStateButton, BorderLayout.EAST);
	return newFilterPanel;
}
 
Example #18
Source File: ImageBorderWizard.java    From CodenameOne with GNU General Public License v2.0 5 votes vote down vote up
private void updateBorderImage() {
    if(useAFile.isSelected()) {
        borderImage.setBorder(null);
        return;
    }
    Border res;
    borderImage.setIcon(null);
    switch(borderType.getSelectedIndex()) {
        case 1: // Line
            res = new LineBorder(getColor(colorA), ((Number)thickness.getValue()).intValue(), true);
            break;
        case 2: // Raised Etched
            res = BorderFactory.createEtchedBorder(EtchedBorder.RAISED, getColor(colorA), getColor(colorB));
            break;
        case 3: // Lowered Etched
            res = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, getColor(colorA), getColor(colorB));
            break;
        case 4: // Raised Bevel
            res = BorderFactory.createBevelBorder(BevelBorder.RAISED, getColor(colorA), getColor(colorB), getColor(colorC), getColor(colorD));
            break;
        case 5: // Lowered Bevel
            res = BorderFactory.createBevelBorder(BevelBorder.LOWERED, getColor(colorA), getColor(colorB), getColor(colorC), getColor(colorD));
            break;
        default: // Round
            res = new RoundedBorder();
            break;
    }
    Color c = getColor(colorC);
    borderImage.setBackground(new Color(c.getRed(), c.getGreen(), c.getBlue(), ((Number)opacity.getValue()).intValue()));
    borderImage.setPreferredSize(new Dimension(((Number)width.getValue()).intValue(),
            ((Number)height.getValue()).intValue()));
    borderImage.setBorder(res);
    borderImage.revalidate();
    borderImage.repaint();
}
 
Example #19
Source File: GrammarVizView.java    From grammarviz2_src with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build the logging panel.
 */
private void buildLogPane() {
  // logging panel
  logTextArea.setFont(new Font("MonoSpaced", Font.PLAIN, 10));
  logTextArea.setEditable(false);
  logTextArea.setCaretPosition(logTextArea.getDocument().getLength());
  logTextPane.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
  logTextPane.setAutoscrolls(true);
  log(Level.INFO, "running GrammarViz 3.0 demo");
}
 
Example #20
Source File: BevelBorderBeanInfo.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected PropertyDescriptor[] createPropertyDescriptors() throws IntrospectionException {
    PropertyDescriptor[] pds = new PropertyDescriptor[] {
        createRO(BevelBorder.class, "bevelType"), // NOI18N
        createRO(BevelBorder.class, "highlightOuterColor"), // NOI18N
        createRO(BevelBorder.class, "highlightInnerColor"), // NOI18N
        createRO(BevelBorder.class, "shadowOuterColor"), // NOI18N
        createRO(BevelBorder.class, "shadowInnerColor"), // NOI18N
    };
    pds[0].setPropertyEditorClass(BevelTypePropertyEditor.class);
    return pds;
}
 
Example #21
Source File: JTableSorted.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
ThreadHeaderRenderer(int modelCol) {
  super(modelCol);

  sort = new JPanel(new BorderLayout());
  sort.setBorder(new BevelBorder(BevelBorder.RAISED));
  sort.add(new JLabel(threadSortIcon), BorderLayout.CENTER);

  unsort = new JPanel(new BorderLayout());
  unsort.setBorder(new BevelBorder(BevelBorder.RAISED));
  unsort.add(new JLabel(threadUnSortIcon), BorderLayout.CENTER);

  comp = unsort;
}
 
Example #22
Source File: PatternSandbox.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Initialize UI components.
 */
protected void initComponents() {

    cboxPattern = new JComboBox<String>();
    cboxPattern.setEditable(true);
    cboxPattern.setRenderer(new ShorteningCellRenderer());
    lblPattern = new JLabel();
    lblPattern.setLabelFor(cboxPattern);
    lblHint = new JLabel();
    lblHint.setEnabled(false);
    lblOptions = new JLabel();
    textPane = new JTextPane();
    textScrollPane = new JScrollPane();
    textScrollPane.setViewportView(textPane);
    textScrollPane.setPreferredSize(new Dimension(350, 100));
    textScrollPane.setBorder(new BevelBorder(BevelBorder.LOWERED));
    searchCriteria = new BasicSearchCriteria();
    initSpecificComponents();
    pnlOptions = createOptionsPanel();
    btnApply = new JButton();
    btnCancel = new JButton();
    cboxPatternForegroundStd = cboxPattern.getEditor().getEditorComponent().
            getForeground();

    initTextPaneContent();
    initHighlighter();

    setMnemonics();
    layoutComponents();
    initInteraction();
    this.addHierarchyListener(this);
    highlightMatchesLater();
}
 
Example #23
Source File: SwingBorderGetterTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testGetter () {
    Scene scene = new Scene ();
    BevelBorder originalBorder = new BevelBorder (BevelBorder.RAISED);
    scene.setBorder (originalBorder);
    Border foundBorder = BorderSupport.getSwingBorder (scene.getBorder ());
    assertEquals (originalBorder, foundBorder);
}
 
Example #24
Source File: RendererFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void delegatedPaint(Graphics g) {
    Color c = g.getColor();

    try {
        g.setColor(getBackground());
        g.fillRect(0, 0, getWidth(), getHeight());
        g.setColor(getForeground());

        if (!tableUI) {
            //in the panel, give self-painting editors a lowered
            //border so they look like something
            Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED);
            b.paintBorder(this, g, 0, 0, getWidth(), getHeight());
        }

        Rectangle r = getBounds();

        //XXX May be the source of Rochelle's multiple rows of error 
        //marking misalignment problem...(I do not jest)
        r.x = (getWidth() > 16) ? ((editor instanceof Boolean3WayEditor) ? 0 : 3) : 0; //align text with other renderers
        r.width -= ((getWidth() > 16) ? ((editor instanceof Boolean3WayEditor) ? 0 : 3) : 0); //align text with other renderers
        r.y = 0;
        editor.paintValue(g, r);
    } finally {
        g.setColor(c);
    }
}
 
Example #25
Source File: KeyStoreTableHeadRend.java    From portecle with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the rendered header cell for the supplied value and column.
 *
 * @param jtKeyStore The JTable
 * @param value The value to assign to the cell
 * @param bIsSelected True if cell is selected
 * @param iRow The row of the cell to render
 * @param iCol The column of the cell to render
 * @param bHasFocus If true, render cell appropriately *
 * @return The rendered cell
 */
@Override
public Component getTableCellRendererComponent(JTable jtKeyStore, Object value, boolean bIsSelected,
    boolean bHasFocus, int iRow, int iCol)
{
	// Get header renderer
	JLabel header = (JLabel) jtKeyStore.getColumnModel().getColumn(iCol).getHeaderRenderer();

	// The entry type header contains an icon
	if (iCol == 0)
	{
		header.setText("");
		ImageIcon icon =
		    new ImageIcon(getClass().getResource(RB.getString("KeyStoreTableHeadRend.TypeColumn.image")));
		header.setIcon(icon);
		header.setHorizontalAlignment(CENTER);
		header.setVerticalAlignment(CENTER);

		header.setToolTipText(RB.getString("KeyStoreTableHeadRend.TypeColumn.tooltip"));
	}
	// The other headers contain text
	else
	{
		header.setText((String) value);
		header.setHorizontalAlignment(LEFT);

		if (iCol == 1)
		{
			header.setToolTipText(RB.getString("KeyStoreTableHeadRend.AliasColumn.tooltip"));
		}
		else
		{
			header.setToolTipText(RB.getString("KeyStoreTableHeadRend.LastModifiedDateColumn.tooltip"));
		}
	}

	header.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new EmptyBorder(0, 5, 0, 5)));

	return header;
}
 
Example #26
Source File: HotelPropertiesWindow.java    From Hotel-Properties-Management-System with GNU General Public License v2.0 5 votes vote down vote up
private void setType() {
    int locationPoint = 323;
    for (int i = 0; i < 3; i++) {

        roomTypes = new JTextField();
        roomTypes.setColumns(10);
        roomTypes.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
        roomTypes.setBounds(locationPoint, 97, 86, 20);
        roomTypes.setVisible(false);
        bottomPanel.add(roomTypes);

        roomTypeFields[i] = roomTypes;
        locationPoint = locationPoint + 96;
    }
}
 
Example #27
Source File: LicenseWindow.java    From Hotel-Properties-Management-System with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create the frame.
 */
public LicenseWindow(final String path) {
	
	setTitle("Coder HPMSA - [License]");
	setBounds(100, 100, 550, 550);
	setBackground(Color.decode("#066d95"));
	setLocationRelativeTo(null);
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	
	this.setIconImage(Toolkit.getDefaultToolkit().
			getImage(getClass().getResource(LOGOPATH)));
	
	final JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
	getContentPane().add(scrollPane, BorderLayout.CENTER);
	
	editorPane = new JTextPane();
	editorPane.setBackground(new Color(255, 255, 240));
	editorPane.setFont(new Font("Verdana", Font.PLAIN, 13));
	editorPane.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
	editorPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	editorPane.setEditable(false);
	scrollPane.setViewportView(editorPane);
	
	final StyledDocument doc = editorPane.getStyledDocument();
	final SimpleAttributeSet center = new SimpleAttributeSet();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	doc.setParagraphAttributes(0, doc.getLength()-1, center, false);
	
	fillEditorPane(path);
	setVisible(true);
}
 
Example #28
Source File: GrammarVizView.java    From grammarviz2_src with GNU General Public License v2.0 5 votes vote down vote up
private void buildChartPane() {
  // MotifChartPanel _chart = new MotifChartPanel(null);
  dataChartPane = new GrammarvizChartPanel();
  dataChartPane.addActionListener(this);
  dataChartPane.session = this.controller.getSession();
  dataChartPane.setBorder(BorderFactory.createTitledBorder(
      BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Data display", TitledBorder.LEFT,
      TitledBorder.CENTER, new Font(TITLE_FONT, Font.PLAIN, 10)));
  MigLayout chartPaneLayout = new MigLayout("insets 0 0 0 0", "[fill,grow]", "[fill,grow]");
  dataChartPane.setLayout(chartPaneLayout);

  // needed to be able to stop guessing...
  //
  dataChartPane.setOperationalButton(this.guessParametersButton);
}
 
Example #29
Source File: FooterBar.java    From Robot-Overlord-App with GNU General Public License v2.0 5 votes vote down vote up
public FooterBar(Frame parent) {
	// create the status bar panel and shove it down the bottom of the frame
	
	this.setBorder(new BevelBorder(BevelBorder.LOWERED));
	//this.setPreferredSize(new Dimension(parent.getWidth(), 16));
	this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
	statusLabel = new JLabel("");
	statusLabel.setHorizontalAlignment(SwingConstants.LEFT);
	this.add(statusLabel);
}
 
Example #30
Source File: BorderBuilders.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
BevelBorderBuilder(Instance instance, Heap heap) {
    super(instance, heap);
    
    bevelType = DetailsUtils.getIntFieldValue(instance, "bevelType", BevelBorder.LOWERED);
    highlightOuter = ColorBuilder.fromField(instance, "highlightOuter", heap);
    highlightInner = ColorBuilder.fromField(instance, "highlightInner", heap);
    shadowInner = ColorBuilder.fromField(instance, "shadowInner", heap);
    shadowOuter = ColorBuilder.fromField(instance, "shadowOuter", heap);
}