public ProtegeWelcomePanel() { setBackground(Color.WHITE); background = Icons.getIcon("logo.wizard.png"); add(panel); label.setFont(getFont().deriveFont(Font.BOLD, 35.0f)); label.setBorder(BorderFactory.createEmptyBorder(30, 0, 50, 0)); label.setForeground(Color.LIGHT_GRAY); panel.add(box, BorderLayout.CENTER); panel.add(createOtherActions(), BorderLayout.SOUTH); refresh();
0, 0, getFont().deriveFont(Font.BOLD), color), BorderFactory.createEmptyBorder(20, 20, 20, 20))); revalidate();
private JComponent createOtherActions() { Color fontColor = PropertyUtil.getColor(ProtegeProperties.getInstance().getProperty(ProtegeProperties.PROPERTY_COLOR_KEY), Color.GRAY); JPanel otherActionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); otherActionsPanel.setBackground(Color.WHITE); JMenuBar littleMenuBar = new JMenuBar(); // littleMenuBar.setBackground(Color.WHITE); littleMenuBar.setOpaque(false); final JMenu dropDownMenu = new JMenu("More actions"); dropDownMenu.setFont(getFont().deriveFont(Font.BOLD, 10.0f)); dropDownMenu.setForeground(fontColor); dropDownMenu.setBackground(Color.WHITE); littleMenuBar.add(dropDownMenu); for (AltStartupActionPlugin plugin : new AltStartupActionPluginLoader(ProtegeWelcomeFrame.this).getPlugins()) { try { AbstractAction a = plugin.newInstance(); JMenuItem subMenu = new JMenuItem(a); dropDownMenu.add(subMenu); } catch (Exception e) { ProtegeApplication.getErrorLog().logError(e); } } otherActionsPanel.add(littleMenuBar); Box southBox = new Box(BoxLayout.Y_AXIS); southBox.setBorder(BorderFactory.createEmptyBorder(0, 50, 0, 0)); southBox.add(otherActionsPanel); return southBox; }
public ProtegeWelcomeFrame() { setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setName("ProtegeWelcome"); welcomePanel = new ProtegeWelcomePanel(); setContentPane(welcomePanel); pack(); centre(); }
public void setVisible(boolean b) { if (b){ welcomePanel.refresh(); pack(); centre(); } super.setVisible(b); }