Java 类javax.swing.border.BevelBorder 实例源码
项目:stendhal
文件:StyleFactory.java
@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;
}
项目:incubator-netbeans
文件:BevelBorderBeanInfo.java
public BevelTypePropertyEditor() {
super(
new int[] {
BevelBorder.RAISED,
BevelBorder.LOWERED,
},
new String[] {
"javax.swing.border.BevelBorder.RAISED", // NOI18N
"javax.swing.border.BevelBorder.LOWERED", // NOI18N
},
new String[] {
"VALUE_BevelRaised", // NOI18N
"VALUE_BevelLowered", // NOI18N
}
);
}
项目:incubator-netbeans
文件:ToggleProfilingPointAction.java
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);
}
项目:incubator-netbeans
文件:BorderBuilders.java
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;
}
项目:KivaBot
文件:MainFrameView.java
/**
* Initialize the panels.
*/
private void initializePanels() {
this.mMainPanel = new JPanel();
this.mMainPanel.setBounds(10, 10, WIDTH - 25, 240);
this.mContainer.add(this.mMainPanel);
this.mMainPanel.setLayout(null);
this.mLogPane = new JScrollPane();
this.mLogPane.setViewportBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
this.mLogPane.setBounds(10, 270, WIDTH - 25, 100);
this.mContainer.add(this.mLogPane);
this.mTrailerPanel = new JPanel();
this.mTrailerPanel.setBounds(10, 370, WIDTH - 25, 50);
this.mContainer.add(this.mTrailerPanel);
this.mTrailerPanel.setLayout(null);
}
项目:Hotel-Properties-Management-System
文件:InformationFrame.java
public InformationFrame() {
setType(Type.POPUP);
setResizable(false);
setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
this.setTitle("Approving question");
this.setPreferredSize(new Dimension(350, 170));
this.setAlwaysOnTop(isAlwaysOnTopSupported());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().setLayout(new BorderLayout());
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(screenSize.width / 2 - 150, screenSize.height / 2 - 75);
this.setIconImage(Toolkit.getDefaultToolkit().getImage(InformationFrame.class.getResource(LOGOPATH)));
final JPanel panel = new JPanel();
getContentPane().add(panel, BorderLayout.CENTER);
panel.setLayout(null);
okBtn = new JButton("OK");
okBtn.setIcon(new ImageIcon(InformationFrame.class.getResource("/com/coder/hms/icons/info_ok.png")));
okBtn.setFont(new Font("Lucida Grande", Font.PLAIN, 15));
okBtn.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
okBtn.setBounds(119, 102, 132, 35);
okBtn.addActionListener(getAction());
panel.add(okBtn);
lblMessage = new JLabel("");
lblMessage.setHorizontalTextPosition(SwingConstants.CENTER);
lblMessage.setHorizontalAlignment(SwingConstants.LEFT);
lblMessage.setBounds(87, 21, 246, 74);
panel.add(lblMessage);
lblIcon = new JLabel("");
lblIcon.setIcon(new ImageIcon(InformationFrame.class.getResource("/com/coder/hms/icons/dialogPane_question.png")));
lblIcon.setBounds(6, 36, 69, 70);
panel.add(lblIcon);
this.pack();
}
项目:sbc-qsystem
文件:FInfoDialogWeb.java
/**
* Creates new form FInfoDialogWeb
*/
public FInfoDialogWeb(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
javafxPanel = new JFXPanel();
javafxPanel.setOpaque(false);
javafxPanel.setBorder(new BevelBorder(0));
javafxPanel.setLayout(new GridLayout(1, 1));
final GridLayout gl = new GridLayout(1, 1);
panel.setLayout(gl);
panel.add(javafxPanel, BorderLayout.CENTER);
Platform.runLater(() -> {
bro = new Browser();
Scene scene = new Scene(bro, 750, 500, Color.web("#666970"));
//bro.load(WelcomeParams.getInstance().infoURL);
javafxPanel.setScene(scene);
});
if (WelcomeParams.getInstance().btnFont != null) {
btnBack.setFont(WelcomeParams.getInstance().btnFont);
btnClose.setFont(WelcomeParams.getInstance().btnFont);
btnForward.setFont(WelcomeParams.getInstance().btnFont);
btnHome.setFont(WelcomeParams.getInstance().btnFont);
}
}
项目:USB3Installer
文件:FooterBar.java
public FooterBar() {
setPreferredSize(new Dimension(640, 16));
setLayout(new GridLayout());
setBorder(new BevelBorder(BevelBorder.LOWERED));
Border margin = new EmptyBorder(0, 5, 0, 5);
label = new JLabel("Ready", SwingConstants.LEFT);
label.setBorder(margin);
add(label);
progress = new JProgressBar();
progress.setMaximum(6);
progress.setStringPainted(true);
progress.setPreferredSize(new Dimension(10, 16));
progress.setValue(0);
add(progress);
}
项目:geokuk
文件:JDebugIkonyDialog.java
@Override
protected void initComponents() {
jvse = Box.createHorizontalBox();
jvse.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
add(jvse);
jskelneikony = Box.createVerticalBox();
jskelneikony.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
jskelneikony.setMinimumSize(new Dimension(250, 150));
debugVyberIkon = new JDebugVyberIkon(jskelneikony);
jvse.add(debugVyberIkon);
jvse.add(Box.createHorizontalStrut(5));
jvse.add(jskelneikony);
jvse.setPreferredSize(new Dimension(700, 600));
}
项目:geokuk
文件:JVyberIkon0.java
protected void initComponents() {
jvyber1 = Box.createVerticalBox();
final JScrollPane sp1 = new JScrollPane(jvyber1);
sp1.setViewportBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
// sp1.setAutoscrolls(true);
FComponent.enableMouseSroll(jvyber1);
jvyber2 = Box.createVerticalBox();
final JScrollPane sp2 = new JScrollPane(jvyber2);
sp2.setViewportBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
FComponent.enableMouseSroll(sp2);
add(sp1);
add(Box.createHorizontalStrut(5));
add(sp2);
}
项目:exterminator
文件:StatusPanel.java
public StatusPanel() {
super();
setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(1, 0, 0, 0, Color.BLACK),
BorderFactory.createCompoundBorder(
BorderFactory.createBevelBorder(BevelBorder.LOWERED),
BorderFactory.createEmptyBorder(3, 3, 3, 3))));
//statusPanel.setPreferredSize(new Dimension(frame.getWidth(), 16));
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
statusLabel = new JLabel(".");
defaultColor = statusLabel.getForeground();
statusLabel.setForeground(statusLabel.getBackground());
// int height = statusLabel.getPreferredSize().height;
statusLabel.setHorizontalAlignment(SwingConstants.LEFT);
// statusLabel.setText("");
add(statusLabel);
//
// Dimension d = getPreferredSize();
// d.height = height + 5;
// setPreferredSize(d);
// System.out.println(d);
}
项目:KivaBot
文件:MainFrameView.java
/**
* Initialize the panels.
*/
private void initializePanels() {
this.mMainPanel = new JPanel();
this.mMainPanel.setBounds(10, 10, WIDTH - 25, 240);
this.mContainer.add(this.mMainPanel);
this.mMainPanel.setLayout(null);
this.mLogPane = new JScrollPane();
this.mLogPane.setViewportBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
this.mLogPane.setBounds(10, 270, WIDTH - 25, 100);
this.mContainer.add(this.mLogPane);
this.mTrailerPanel = new JPanel();
this.mTrailerPanel.setBounds(10, 370, WIDTH - 25, 50);
this.mContainer.add(this.mTrailerPanel);
this.mTrailerPanel.setLayout(null);
}
项目:bisis-v4
文件:SplashScreen.java
public SplashScreen() {
p = new JPanel();
//p.setPreferredSize(new Dimension(400,300));
p.setLayout(new BorderLayout());
p.add(image, BorderLayout.CENTER);
p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
message.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
message.setHorizontalAlignment(SwingConstants.LEFT);
progressBar.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
progressBar.setIndeterminate(true);
Box box = Box.createVerticalBox();
box.add(message);
box.add(progressBar);
p.add(box, BorderLayout.SOUTH);
setContentPane(p);
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
pack();
Dimension screen = getToolkit().getScreenSize();
setLocation((screen.width - getSize().width) / 2,
(screen.height - getSize().height) / 2);
}
项目:portecle
文件:RevokedCertsTableHeadRend.java
/**
* 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;
}
项目:portecle
文件:JarInfoTableHeadRend.java
/**
* Returns the rendered header cell for the supplied value and column.
*
* @param jtJarInfo 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 jtJarInfo, Object value, boolean bIsSelected,
boolean bHasFocus, int iRow, int iCol)
{
// Get header renderer
JLabel header = (JLabel) jtJarInfo.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;
}
项目:portecle
文件:SystemPropertiesTableHeadRend.java
/**
* 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;
}
项目:geoxygene
文件:ColourTableCellRenderer.java
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
ColourTableModel model = (ColourTableModel) table.getModel();
table.setRowHeight(20);
for (int i = 0; i < model.getColumnCount(); i++) {
table.getColumnModel().getColumn(i).setWidth(20);
}
// Cell background
Component cell = super.getTableCellRendererComponent(table, value,
isSelected, hasFocus, row, column);
Color col = model.getValueAt(1, column);
cell.setBackground(col);
// Cell border if selected
if (isSelected) {
((JComponent) cell).setBorder(BorderFactory
.createBevelBorder(BevelBorder.LOWERED, Color.WHITE, Color.BLACK));
}
return cell;
}
项目:javify
文件:BasicBorders.java
/**
* Returns a border that is composed of a raised bevel border and a
* one-pixel thick line border.
*
* <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
* alt="[A screen shot of a border returned by this method]" />
*
* <p>The colors of the border are retrieved from the
* <code>UIDefaults</code> of the currently active look and feel
* using the keys <code>“InternalFrame.borderShadow”</code>,
* <code>“InternalFrame.borderDarkShadow”</code>,
* <code>“InternalFrame.borderLight”</code>,
* <code>“InternalFrame.borderHighlight”</code>, and
* (for the inner one-pixel thick line)
* <code>“InternalFrame.borderColor”</code>.
*/
public static Border getInternalFrameBorder()
{
Color shadow, darkShadow, highlight, lightHighlight, line;
/* See comment in methods above for why this border is not shared. */
shadow = UIManager.getColor("InternalFrame.borderShadow");
darkShadow = UIManager.getColor("InternalFrame.borderDarkShadow");
highlight = UIManager.getColor("InternalFrame.borderLight");
lightHighlight = UIManager.getColor("InternalFrame.borderHighlight");
line = UIManager.getColor("InternalFrame.borderColor");
return new BorderUIResource.CompoundBorderUIResource(
/* outer border */
new BorderUIResource.BevelBorderUIResource(
BevelBorder.RAISED,
(highlight != null) ? highlight : Color.lightGray,
(lightHighlight != null) ? lightHighlight : Color.white,
(darkShadow != null) ? darkShadow : Color.black,
(shadow != null) ? shadow : Color.gray),
/* inner border */
new BorderUIResource.LineBorderUIResource(
(line != null) ? line : Color.lightGray));
}
项目:unison
文件:JSplashScreen.java
/**
* Instantiates a new j splash screen.
*
* @param description
* the description
* @param frame
* the frame
*/
public JSplashScreen(final String description, final JFrame frame) {
super(frame, description, false);
final JPanel PanelForBorder = new JPanel(new BorderLayout());
PanelForBorder.setLayout(new BorderLayout());
final JLabel image = new JLabel(description);
image.setVisible(true);
PanelForBorder.add(image, BorderLayout.CENTER);
PanelForBorder.add(this.statusBar = new JProgressBar(0, 100), BorderLayout.SOUTH);
this.statusBar.setVisible(true);
PanelForBorder.setBorder(new BevelBorder(BevelBorder.RAISED));
PanelForBorder.setVisible(true);
this.add(PanelForBorder);
this.pack();
// Plonk it on center of screen
final Dimension WindowSize = this.getSize();
final Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.setBounds((ScreenSize.width - WindowSize.width) / 2,
(ScreenSize.height - WindowSize.height) / 2, WindowSize.width, WindowSize.height);
this.setVisible(true);
}
项目:IpTweet
文件:UserListCellRenderer.java
public Component getListCellRendererComponent(JList<? extends User> list,
User user, int index, boolean isSelected, boolean cellHasFocus) {
if(index%2==0){
setOpaque(true);
setBackground(new Color(240,240,255));
}
else{
setOpaque(false);
}
if (user != null) {
setText(user.getDisplayName() + " (" + user.getHostName() + ")");
if (chatInitiatorUserName != null) {
if (isSelected) {
setOpaque(true);
setBackground(new Color(210,210,255));
//setForeground(ChatConstant.WELCOME_LBL_COLOR);
setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
} else {
setBorder(BorderFactory.createEmptyBorder());
setForeground(ChatConstant.SENT_MSG_COLOR);
}
}
}
return this;
}
项目:intellij-ce-playground
文件:CommanderPanel.java
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()) {
myList.requestFocus();
}
}
else if (myList.getModel().getSize() > 0) {
// need this to generate SelectionChanged events so that listeners, added by Commander, will be notified
myList.setSelectedIndices(selectedIndices);
}
}
项目:cmoct-sourcecode
文件:VolRendView.java
JPanel setupPanelGUI()
{
if (debug)
System.out.println(" in setupPanelGUI()");
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.setBorder(new BevelBorder(BevelBorder.RAISED));
panel.add(new JLabel(
"Press the mouse button and drag to move the model"));
Colormap cmap = volRend.getColorModeAttr().getColormap();
if (cmap instanceof SegyColormap)
{
SegyColormap segyCmap = (SegyColormap) cmap;
panel.add(new SegyCmapEditor(volRend, segyCmap));
}
panel.validate();
return panel;
}
项目:mars-sim
文件:ToolToolBar.java
/**
* Constructs a ToolToolBar object
* @param parentMainWindow the main window pane
*/
public ToolToolBar(MainWindow parentMainWindow) {
// Use JToolBar constructor
super(JToolBar.HORIZONTAL);
// Initialize data members
toolButtons = new Vector<ToolButton>();
this.parentMainWindow = parentMainWindow;
// Set name
setName(Msg.getString("ToolToolBar.toolbar")); //$NON-NLS-1$
// Fix tool bar
setFloatable(false);
setPreferredSize(new Dimension(0, 32));
// Prepare tool buttons
prepareToolButtons();
// Set border around toolbar
setBorder(new BevelBorder(BevelBorder.RAISED));
}
项目:mars-sim
文件:UnitToolBar.java
/**
* Constructs a UnitToolBar object
*
* @param parentMainWindow
* the main window pane
*/
public UnitToolBar(MainWindow parentMainWindow) {
// Use JToolBar constructor
super();
setOpaque(false);
setBackground(new Color(0,0,0,128));
// Initialize data members
unitButtons = new ArrayList<UnitButton>();
this.parentMainWindow = parentMainWindow;
// Set name
setName("Unit Toolbar");
// Fix tool bar
setFloatable(false);
// Set preferred height to 57 pixels.
setPreferredSize(new Dimension(0, 57));
// Set border around toolbar
setBorder(new BevelBorder(BevelBorder.RAISED));
}
项目:jablus
文件:WeatherView.java
public WeatherGlyph(
int day,
DoubleData rain,
DoubleData tmpAvg,
// DoubleData tmpMin,
DoubleData rad,
DoubleData radAvg){
this.day = day;
this.rain = rain;
this.tmpAvg = tmpAvg;
// this.tmpMin = tmpMin;
this.rad = rad;
this.radAvg = radAvg;
setHorizontalAlignment(JLabel.CENTER);
setVerticalAlignment(JLabel.CENTER);
setBorder(new EtchedBorder());
setBorder(new BevelBorder(BevelBorder.RAISED));
setBorder(new LineBorder(Color.LIGHT_GRAY));
setPreferredSize(new Dimension(45, 55));
redisplay();
}
项目:jvm-stm
文件:BasicBorders.java
/**
* Returns a border that is composed of a raised bevel border and a
* one-pixel thick line border.
*
* <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
* alt="[A screen shot of a border returned by this method]" />
*
* <p>The colors of the border are retrieved from the
* <code>UIDefaults</code> of the currently active look and feel
* using the keys <code>“InternalFrame.borderShadow”</code>,
* <code>“InternalFrame.borderDarkShadow”</code>,
* <code>“InternalFrame.borderLight”</code>,
* <code>“InternalFrame.borderHighlight”</code>, and
* (for the inner one-pixel thick line)
* <code>“InternalFrame.borderColor”</code>.
*/
public static Border getInternalFrameBorder()
{
Color shadow, darkShadow, highlight, lightHighlight, line;
/* See comment in methods above for why this border is not shared. */
shadow = UIManager.getColor("InternalFrame.borderShadow");
darkShadow = UIManager.getColor("InternalFrame.borderDarkShadow");
highlight = UIManager.getColor("InternalFrame.borderLight");
lightHighlight = UIManager.getColor("InternalFrame.borderHighlight");
line = UIManager.getColor("InternalFrame.borderColor");
return new BorderUIResource.CompoundBorderUIResource(
/* outer border */
new BorderUIResource.BevelBorderUIResource(
BevelBorder.RAISED,
(highlight != null) ? highlight : Color.lightGray,
(lightHighlight != null) ? lightHighlight : Color.white,
(darkShadow != null) ? darkShadow : Color.black,
(shadow != null) ? shadow : Color.gray),
/* inner border */
new BorderUIResource.LineBorderUIResource(
(line != null) ? line : Color.lightGray));
}
项目:swingx
文件:WindowsClassicStatusBarUI.java
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) {
g.setColor(bar.getBackground());
g.fillRect(0, 0, bar.getWidth(), bar.getHeight());
//paint an inset border around each component. This suggests that
//there is an extra border around the status bar...!
Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED,
Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY);
Insets insets = new Insets(0, 0, 0, 0);
for (Component c : bar.getComponents()) {
getSeparatorInsets(insets);
int x = c.getX() - insets.right;
int y = c.getY() - 2;
int w = c.getWidth() + insets.left + insets.right;
int h = c.getHeight() + 4;
b.paintBorder(c, g, x, y, w, h);
}
}
项目:ClassicDecoratorPattern
文件:EtchedBorderDecoratorTest.java
@Test
public void testBorder() throws Exception {
final int borderStyle = BevelBorder.LOWERED;
final Color upper = Color.GREEN;
final Color lower = Color.CYAN;
etchedBorderDecorator.set(borderStyle, upper, lower);
final EtchedBorder etchedBorder = new EtchedBorder(borderStyle, upper, lower);
final Border border = button.getBorder();
assertEquals(border.getClass(), etchedBorder.getClass());
assertEquals(((EtchedBorder) border).getEtchType(), etchedBorder.getEtchType());
assertEquals(((EtchedBorder) border).getHighlightColor(), etchedBorder.getHighlightColor());
assertEquals(((EtchedBorder) border).getShadowColor(), etchedBorder.getShadowColor());
assertEquals(border.isBorderOpaque(), etchedBorder.isBorderOpaque());
}
项目:ClassicDecoratorPattern
文件:BevelBorderDecoratorTest.java
@Test
public void testBorder() throws Exception {
final int borderStyle = BevelBorder.LOWERED;
final Color upper = Color.GREEN;
final Color lower = Color.CYAN;
bevelBorderDecorator.set(borderStyle, upper, lower);
final BevelBorder bevel = new BevelBorder(borderStyle, upper, lower);
assertEquals(button.getBorder().getClass(), bevel.getClass());
assertEquals(((BevelBorder)button.getBorder()).getBevelType(), bevel.getBevelType());
assertEquals(((BevelBorder)button.getBorder()).getHighlightInnerColor(), bevel.getHighlightInnerColor());
assertEquals(((BevelBorder)button.getBorder()).getShadowInnerColor(), bevel.getShadowInnerColor());
assertEquals(((BevelBorder)button.getBorder()).getHighlightOuterColor(), bevel.getHighlightOuterColor());
assertEquals(((BevelBorder)button.getBorder()).getShadowOuterColor(), bevel.getShadowOuterColor());
}
项目:stendhal
文件:StyleFactory.java
@Override
Style create() {
// Text
Color highlight = new Color(184, 149, 193);
Color shadow = new Color(42, 7, 51);
PixmapStyle style = new PixmapStyle("data/gui/panel_aubergine_001.png",
false, highlight, shadow, Color.white, Color.white);
// Border
Color bhighdark = new Color (119,74,130);
Color bshadowlight = new Color(84, 42, 95);
Color bshadowdark = new Color(37, 1, 46);
style.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
bhighdark, highlight, bshadowdark, bshadowlight));
style.setBorderDown(BorderFactory.createBevelBorder(BevelBorder.LOWERED,
bhighdark, highlight, bshadowdark, bshadowlight));
return style;
}
项目:stendhal
文件:StyleFactory.java
@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;
}
项目:stendhal
文件:StyleFactory.java
@Override
Style create() {
// Text
Color foreground = Color.white;
Color highlight = new Color(130, 130, 130); // Grey
PixmapStyle style = new PixmapStyle("data/gui/panel_leather_black_001.png",
false, highlight, Color.black, Color.white, foreground);
// Border
Color bhighout = new Color(120, 120, 120);
Color bhighin = new Color(80, 80, 80);
Color bshadowin = new Color(40, 40, 40);
style.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
bhighout, bhighin, Color.black, bshadowin));
style.setBorderDown(BorderFactory.createBevelBorder(BevelBorder.LOWERED,
bhighout, bhighin, bshadowin, Color.black));
return style;
}
项目:stendhal
文件:StyleFactory.java
@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;
}
项目:pinenut
文件:Emptree.java
private void setGUI() {
treePanel = new JPanel();
getContentPane().add(treePanel);
treePanel.setLayout(new BorderLayout());
sp = new JScrollPane();
treePanel.add("Center", sp);
treePanel.add("South", cost = new JLabel(" "));
treePanel.setBorder(new BevelBorder(BevelBorder.RAISED));
troot = new DefaultMutableTreeNode(boss.getName());
tree = new JTree(troot);
tree.setBackground(Color.lightGray);
loadTree(boss);
/* Put the Tree in a scroller. */
sp.getViewport().add(tree);
setSize(new Dimension(200, 300));
setVisible(true);
}
项目:tellapic
文件:PaintPropertyView.java
/**
*
*/
private void createColorOptions() {
Dimension iconDimension = new Dimension(ToolView.ICON_SIZE + 8, ToolView.ICON_SIZE + 8);
colorLabel = new JLabel(Utils.msg.getString("strokecolor")+":");
colorField = new JLabel();
colorLabel.setIcon(new ImageIcon(Utils.createIconImage(ToolView.ICON_SIZE, ToolView.ICON_SIZE, "/icons/tools/color1.png")));
colorLabel.setLabelFor(colorField);
colorLabel.setFont(defaultTitleFont);
colorLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
colorLabel.addMouseListener(new ColorSelectionListener(colorLabel));
colorField.setPreferredSize(iconDimension);
colorField.setOpaque(true);
colorField.setBorder(BorderFactory.createCompoundBorder(new LineBorder(new Color(209, 209, 209), 1, true), new SoftBevelBorder(BevelBorder.LOWERED)));
colorField.setBackground(DEFAULT_COLOR);
colorField.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
colorField.setToolTipText(Utils.msg.getString("colorfieldtooltip"));
colorField.addMouseListener(new ColorSelectionListener(colorField));
}
项目:jMovieManager
文件:MyBasicComboBoxUI.java
/**
* Creates and initializes the components which make up the
* aggregate combo box. This method is called as part of the UI
* installation process.
*/
@Override
protected void installComponents() {
arrowButton = createArrowButton();
comboBox.add( arrowButton );
if (arrowButton != null) {
configureArrowButton();
}
if ( comboBox.isEditable() ) {
addEditor();
}
arrowButton.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
listBox.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
comboBox.add( currentValuePane );
}
项目:compomics-utilities
文件:DateChooser.java
/**
* Called if a date is clicked.
*
* @param aCounter the index if the clicked day
*/
private void dateClicked(int aCounter) {
iSelectedDayIndex = aCounter;
int currentDay = iDays[iSelectedDayIndex].intValue();
if(iSelectedCalendar == null) {
iSelectedCalendar = Calendar.getInstance();
}
iSelectedCalendar.set(iShownCalendar.get(Calendar.YEAR), iShownCalendar.get(Calendar.MONTH), currentDay);
for (int i = 0; i < lblDays.length; i++) {
if(i == iSelectedDayIndex) {
lblDays[i].setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
} else {
lblDays[i].setBorder(BorderFactory.createEmptyBorder());
}
}
}
项目:metasfresh
文件:PerformanceIndicator.java
/**
* Constructor
* @param goal goal model
*/
public PerformanceIndicator(MGoal goal)
{
super();
m_goal = goal;
setName(m_goal.getName());
//vpj-cd e-evolution getPreferredSize(); // calculate size
init();
//
setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
setOpaque(true);
//vpj-cd e-evolution updateDisplay();
//
mRefresh.addActionListener(this);
popupMenu.add(mRefresh);
//
addMouseListener(this);
}
项目:tellervo
文件:JTableStatusBar.java
public JTableStatusBar(JTable tbl)
{
this.tbl = tbl;
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
add(Box.createHorizontalGlue());
add(Box.createHorizontalStrut(2));
add(label);
add(Box.createHorizontalStrut(2));
tbl.getModel().addTableModelListener(new TableModelListener(){
@Override
public void tableChanged(TableModelEvent arg0) {
update();
}
});
update();
}
项目:bidal
文件:AnalysisWindow.java
/**
* Creates the popup used to delete a command.
*/
public void popupListCommands() {
popup4 = new JPopupMenu();
ActionListener menuListener = new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand().equals("Delete")){
int n = getListSelectedCommands().getSelectedIndex();
DefaultListModel dlm1 = (DefaultListModel)getListSelectedCommands().getModel();
dlm1.remove(n);
selectedcommandlist.remove(n);
}
updateCommandArea();
}
};
JMenuItem item;
popup4.add(item = new JMenuItem("Delete"));
item.addActionListener(menuListener);
popup4.setBorder(new BevelBorder(BevelBorder.RAISED));
}