public HDMColdAccountForm(final WalletListPanel walletListPanel) { this.walletListPanel = walletListPanel; inactiveBackGroundColor = Color.WHITE; selected = false; panelMain.setOpaque(true); panelMain.setFocusable(true); panelMain.setBackground(inactiveBackGroundColor); if (ColorAndFontConstants.isInverse()) { inactiveBackGroundColor = new Color( Math.min(255, Themes.currentTheme.detailPanelBackground().getRed() + 2 * COLOR_DELTA), Math.min( 255, Themes.currentTheme.detailPanelBackground().getBlue() + 2 * COLOR_DELTA), Math.min( 255, Themes.currentTheme.detailPanelBackground().getGreen() + 2 * COLOR_DELTA)); } else { inactiveBackGroundColor = new Color( Math.max(0, Themes.currentTheme.detailPanelBackground().getRed() - COLOR_DELTA), Math.max(0, Themes.currentTheme.detailPanelBackground().getBlue() - COLOR_DELTA), Math.max(0, Themes.currentTheme.detailPanelBackground().getGreen() - COLOR_DELTA)); } panelMain.applyComponentOrientation( ComponentOrientation.getOrientation(LocaliserUtils.getLocale())); updateFromModel(); panelMain.addMouseListener( new WalletMouseListener(this.walletListPanel, HDMColdAccountForm.this)); setSelected(false); setContent(); }
public BrowserFrame(Browser b) { super("Cavity Nesting DB Browser"); browser = b; JPanel content = new JPanel(new BorderLayout()); content.setOpaque(true); setContentPane(content); content.add(browser, BorderLayout.CENTER); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); addWindowListener( new WindowAdapter() { public void windowClosed(WindowEvent e) { browser.closeBrowser(); } }); createJMenuBar(); setJMenuBar(menubar); setVisible(true); pack(); }
/** Description of the Method */ public void init() { // super.init(); size = new Dimension(570, 570); contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); Dimension d = messagePanel.getSize(); d.height += 20; messagePanel.setPreferredSize(d); contentPane.add(messagePanel, BorderLayout.SOUTH); contentPane.setOpaque(true); userPanel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(2, 2, 2, 2); messagePanel.setLayout(borderLayout5); contentPane.setOpaque(true); contentPane.setBackground(Color.white); this.setSize(size); messagePanel.add(labelMessage, BorderLayout.NORTH); // Logg.logg("MhClient: Före XttTree-skapande", 6); this.mhTable = new MhTable(root, false, this.labelMessage); // Logg.logg("MhClient: mhTable-skapande klart", 6); this.contentPane.add(this.mhTable.splitPane, BorderLayout.CENTER); }
public FileNameRenderer(JTable table) { Border b = UIManager.getBorder("Table.noFocusBorder"); if (Objects.isNull(b)) { // Nimbus??? Insets i = focusCellHighlightBorder.getBorderInsets(textLabel); b = BorderFactory.createEmptyBorder(i.top, i.left, i.bottom, i.right); } noFocusBorder = b; p.setOpaque(false); panel.setOpaque(false); // http://www.icongalore.com/ XP Style Icons - Windows Application Icon, Software XP Icons nicon = new ImageIcon(getClass().getResource("wi0063-16.png")); sicon = new ImageIcon( p.createImage( new FilteredImageSource(nicon.getImage().getSource(), new SelectedImageFilter()))); iconLabel = new JLabel(nicon); iconLabel.setBorder(BorderFactory.createEmptyBorder()); p.add(iconLabel, BorderLayout.WEST); p.add(textLabel); panel.add(p, BorderLayout.WEST); Dimension d = iconLabel.getPreferredSize(); dim.setSize(d); table.setRowHeight(d.height); }
/** Funkcja inicjalizująca komponenty */ private void initializeComponent() { setSize(FrameSize.getWidth(), FrameSize.getHeight()); setLayout(new BorderLayout()); bgComponent = new BackgroundComponent("loginBG.jpg"); bgComponent.setLayout(new BorderLayout()); JPanel containerPanel = new JPanel(); containerPanel.setOpaque(false); containerPanel.setLayout(new GridLayout(2, 2)); JLabel name = new JLabel("Nazwa użytkownika:"); name.setForeground(Color.WHITE); containerPanel.add(name); username = new JTextField(defaultOptions.getDefaultUsername()); containerPanel.add(username); JLabel passwdLabel = new JLabel("wprowadż hasło:"); passwdLabel.setForeground(Color.WHITE); containerPanel.add(passwdLabel); password = new JPasswordField(""); containerPanel.add(password); bgComponent.add(containerPanel, BorderLayout.NORTH); okButton = new JButton("zatwierdź"); okButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent event) { if (!user.isLoggedIn()) { LoginController loginController = new LoginController(); if (loginController.logIn(username.getText(), password.getPassword().toString())) { parent.hideLoginPanel(); parent.showCreateTaskJPanel(); } } } }); guestSessionButton = new JButton("policz jako gość"); guestSessionButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent event) { parent.hideLoginPanel(); parent.showCreateTaskJPanel(); } }); JPanel buttonContainerPanel = new JPanel(); buttonContainerPanel.setOpaque(false); buttonContainerPanel.add(okButton); buttonContainerPanel.add(guestSessionButton); bgComponent.add(buttonContainerPanel, BorderLayout.SOUTH); add(bgComponent); }
public void buildCenter() { pCenter1.setOpaque(false); pCenter2.setOpaque(false); add("Center", pCenter1); pCenter1.add(title); pCenter1.add(pCenter2); pCenter2.add(weight); pCenter2.add(weight1); pCenter2.add(newWeight); pCenter2.add(weight2); }
/** * Called by the constructor methods to create the default <code>glassPane</code>. By default this * method creates a new <code>JComponent</code> with visibility set to false. * * @return the default <code>glassPane</code> */ protected Component createGlassPane() { JComponent c = new JPanel(); c.setName(this.getName() + ".glassPane"); c.setVisible(false); ((JPanel) c).setOpaque(false); return c; }
private void createProgressPanel() { myProgressIcon = new AsyncProcessIcon("Designer progress"); myProgressMessage = new JLabel(); JPanel progressBlock = new JPanel(); progressBlock.add(myProgressIcon); progressBlock.add(myProgressMessage); progressBlock.setBorder(IdeBorderFactory.createRoundedBorder()); myProgressPanel = new JPanel(new GridBagLayout()); myProgressPanel.add( progressBlock, new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); myProgressPanel.setOpaque(false); }
@Override protected void addComponents() { // add descriptive panel JPanel metaDataPanel = new JPanel(); metaDataPanel.setOpaque(false); metaDataPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); // table label JLabel tableLabel = new JLabel("<html><b>" + PSM_TABLE_DESC + "</b></html>"); metaDataPanel.add(tableLabel); this.add(metaDataPanel, BorderLayout.NORTH); psmTable = TableFactory.createPSMTable( controller.getAvailablePeptideLevelScores(), PeptideRankingFilter.LESS_EQUAL_THAN_ONE.getRankingThreshold(), controller); // add PSM table selection listener psmTable.getSelectionModel().addListSelectionListener(new PSMSelectionListener(psmTable)); JScrollPane scrollPane = new JScrollPane( psmTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); }
public void actionPerformed(ActionEvent e) { if (e.getSource() == ctl) { this.menu(); } else if (e.getSource() == exit) { exitPerform(); } else if (e.getSource() == rank) { if (count != 0) { card.show(mainPanel, "four"); rankPanel.setMemory(memory, count - 1); buttonPanel.removeAll(); buttonPanel.setBounds(width - 200, height - 80, 190, 50); buttonPanel.add(exit); check = 4; count--; } } else if (e.getSource() == back) { if (secondPanel.clip != null) { secondPanel.clip.stop(); System.out.printf("test"); } check = 0; card.previous(mainPanel); buttonPanel.removeAll(); ctl.setText("- Play -"); buttonPanel.add(ctl); buttonPanel.add(rank); buttonPanel.add(exit); buttonPanel.setOpaque(false); buttonPanel.setBounds(width / 2 - 50, height / 2 - 50, 80, 100); } }
public void changePanel() { card.next(mainPanel); buttonPanel.removeAll(); ctl.setText("- Play -"); buttonPanel.add(ctl); buttonPanel.add(rank); buttonPanel.add(exit); buttonPanel.setOpaque(false); buttonPanel.setBounds(width / 2 - 50, height / 2 - 50, 80, 100); count++; memory[count] = new Memory(); menuPanel.setMemory(memory[count]); secondPanel.setMemory(memory[count]); gamePanel.setMemory(memory[count]); rankPanel.setMemory(memory, count); check = 0; System.out.println( count + " " + memory[count - 1].name + " " + memory[count - 1].song + " " + memory[count - 1].score); }
// Create small Pits in board private JPanel centerBoardPanel() { JPanel centerPanel = new JPanel(new GridLayout(2, 6, 20, 100)); centerPanel.setOpaque(false); /*Initialize/Create buttons Array */ buttons = new JButton[SMALL_PIT_COUNT]; for (int i = 0; i < SMALL_PIT_COUNT; i++) { if (i < SMALL_PIT_COUNT / 2) { JButton b = new JButton(String.valueOf(game.board.getPitAt(i).getCount())); b.setFont(new Font("Belta Regular", Font.BOLD, 32)); b.addActionListener(new ButtonListener()); buttons[i] = b; } else { JButton b = new JButton(String.valueOf(game.board.getPitAt(i + 1).getCount())); b.setFont(new Font("Belta Regular", Font.BOLD, 32)); b.addActionListener(new ButtonListener()); buttons[i] = b; } } for (int i = SMALL_PIT_COUNT - 1; i >= 6; i--) { buttons[i].setBackground(new Color(214, 162, 173)); centerPanel.add(buttons[i]); } for (int j = 0; j < SMALL_PIT_COUNT / 2; j++) { buttons[j].setBackground(new Color(214, 162, 173)); centerPanel.add(buttons[j]); } return centerPanel; }
/** Initialize the panel containing the node. */ public PluginListCellRenderer() { super(new BorderLayout(8, 8)); JPanel mainPanel = new JPanel(new BorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); this.setBackground(Color.WHITE); this.setOpaque(true); mainPanel.setOpaque(false); this.nameVersionPanel.setOpaque(false); this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); this.nameLabel.setIconTextGap(2); this.nameLabel.setFont(this.getFont().deriveFont(Font.BOLD)); this.systemLabel.setFont(this.getFont().deriveFont(Font.BOLD)); this.nameVersionPanel.add(nameLabel); this.nameVersionPanel.add(versionLabel); mainPanel.add(nameVersionPanel, BorderLayout.NORTH); mainPanel.add(descriptionLabel, BorderLayout.CENTER); this.add(iconLabel, BorderLayout.WEST); this.add(mainPanel, BorderLayout.CENTER); this.add(stateLabel, BorderLayout.WEST); }
public void setBattleFieldBackground(String background) { ((JPanel) c).setOpaque(false); ImageIcon imgi = new ImageIcon(background); JLabel img_label = new JLabel(imgi); this.getLayeredPane().add(img_label, new Integer(Integer.MIN_VALUE + 1)); img_label.setBounds(posX, posY, Constant.BATTLEFIELD_WIDTH, Constant.BATTLEFIELD_HEIGHT); }
public void setBackground(String background) { ((JPanel) c).setOpaque(false); ImageIcon imgi = new ImageIcon(background); JLabel img_label = new JLabel(imgi); this.getLayeredPane().add(img_label, new Integer(Integer.MIN_VALUE)); img_label.setBounds(0, 0, width, height); }
private static JComponent wrap(@NotNull JComponent content, @NotNull String title) { JPanel result = new JPanel(new BorderLayout()); result.setOpaque(false); result.setBorder(IdeBorderFactory.createTitledBorder(title, false)); result.add(content, BorderLayout.CENTER); return result; }
private JPanel readSplitter( JPanel panel, Element splitterElement, Ref<EditorWindow> currentWindow) { final boolean orientation = "vertical".equals(splitterElement.getAttributeValue("split-orientation")); final float proportion = Float.valueOf(splitterElement.getAttributeValue("split-proportion")).floatValue(); final Element first = splitterElement.getChild("split-first"); final Element second = splitterElement.getChild("split-second"); Splitter splitter; if (panel == null) { panel = new JPanel(new BorderLayout()); panel.setOpaque(false); splitter = new Splitter(orientation, proportion, 0.1f, 0.9f); panel.add(splitter, BorderLayout.CENTER); splitter.setFirstComponent(readExternalPanel(first, null, currentWindow)); splitter.setSecondComponent(readExternalPanel(second, null, currentWindow)); } else if (panel.getComponent(0) instanceof Splitter) { splitter = (Splitter) panel.getComponent(0); readExternalPanel(first, (JPanel) splitter.getFirstComponent(), currentWindow); readExternalPanel(second, (JPanel) splitter.getSecondComponent(), currentWindow); } else { readExternalPanel(first, panel, currentWindow); readExternalPanel(second, panel, currentWindow); } return panel; }
/** Sets opaqueness of this entry. */ public void setOpaque(boolean opaque) { if (guiInitialized) { moneyField.setOpaque(opaque); } super.setOpaque(opaque); }
/** GUIコンポーネントを初期化する。 */ public void initComponent() { frame = new JFrame(ClientContext.getFrameTitle(title)); frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); frame.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { stop(); } }); JPanel contentPane = createBrowsePane(); contentPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 11, 11)); contentPane.setOpaque(true); frame.setContentPane(contentPane); frame.pack(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int n = ClientContext.isMac() ? 3 : 2; int x = (screen.width - frame.getPreferredSize().width) / 2; int y = (screen.height - frame.getPreferredSize().height) / n; frame.setLocation(x, y); blockGlass = new BlockGlass(); frame.setGlassPane(blockGlass); frame.setVisible(true); }
private void populateShop() { final String constraints1 = "w 60px, h 26px!"; final String constraints2 = "w 150px!, h 26px!"; pnlShop.setOpaque(false); pnlShop.setLayout(new MigLayout("insets 0, gap 0, wrap 2, hidemode 3")); pnlShop.removeAll(); pnlShop.add(lblErrShop, "w 100%!, h 30px!, span 2 1"); pnlShop.add(new FLabel.Builder().text("Maximum Packs").build(), constraints2); pnlShop.add(new PrefInput(QPref.SHOP_MAX_PACKS, QuestPreferencesErrType.SHOP), constraints1); pnlShop.add(new FLabel.Builder().text("Starting Packs").build(), constraints2); pnlShop.add( new PrefInput(QPref.SHOP_STARTING_PACKS, QuestPreferencesErrType.SHOP), constraints1); pnlShop.add(new FLabel.Builder().text("Wins for Pack").build(), constraints2); pnlShop.add( new PrefInput(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK, QuestPreferencesErrType.SHOP), constraints1); pnlShop.add(new FLabel.Builder().text("Wins per Set Unlock").build(), constraints2); pnlShop.add(new PrefInput(QPref.WINS_UNLOCK_SET, QuestPreferencesErrType.SHOP), constraints1); pnlShop.add(new FLabel.Builder().text("Common Singles").build(), constraints2); pnlShop.add( new PrefInput(QPref.SHOP_SINGLES_COMMON, QuestPreferencesErrType.SHOP), constraints1); pnlShop.add(new FLabel.Builder().text("Uncommon Singles").build(), constraints2); pnlShop.add( new PrefInput(QPref.SHOP_SINGLES_UNCOMMON, QuestPreferencesErrType.SHOP), constraints1); pnlShop.add(new FLabel.Builder().text("Rare Singles").build(), constraints2); pnlShop.add(new PrefInput(QPref.SHOP_SINGLES_RARE, QuestPreferencesErrType.SHOP), constraints1); }
public UpgradesPanel(ORUIManager orUIManager) { super(BoxLayout.Y_AXIS); this.orUIManager = orUIManager; preferredSize = new Dimension((int) Math.round(100 * (2 + Scale.getFontScale()) / 3), 200); setSize(preferredSize); setVisible(true); upgradePanel = new JPanel(); upgradePanel.setOpaque(true); upgradePanel.setBackground(Color.DARK_GRAY); upgradePanel.setBorder(border); upgradePanel.setLayout(new GridLayout(defaultNbPanelElements, 1)); scrollPane = new JScrollPane(upgradePanel); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setSize(getPreferredSize()); doneButton.setActionCommand("Done"); doneButton.setMnemonic(KeyEvent.VK_D); doneButton.addActionListener(this); cancelButton.setActionCommand("Cancel"); cancelButton.setMnemonic(KeyEvent.VK_C); cancelButton.addActionListener(this); add(scrollPane); }
private JComponent createSettingsPanel() { JPanel result = new JPanel(new FlowLayout(FlowLayout.RIGHT, 3, 0)); result.add(new JLabel(ApplicationBundle.message("label.font.size"))); myFontSizeSlider = new JSlider(JSlider.HORIZONTAL, 0, FontSize.values().length - 1, 3); myFontSizeSlider.setMinorTickSpacing(1); myFontSizeSlider.setPaintTicks(true); myFontSizeSlider.setPaintTrack(true); myFontSizeSlider.setSnapToTicks(true); UIUtil.setSliderIsFilled(myFontSizeSlider, true); result.add(myFontSizeSlider); result.setBorder(BorderFactory.createLineBorder(UIUtil.getBorderColor(), 1)); myFontSizeSlider.addChangeListener( new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { if (myIgnoreFontSizeSliderChange) { return; } EditorColorsManager colorsManager = EditorColorsManager.getInstance(); EditorColorsScheme scheme = colorsManager.getGlobalScheme(); scheme.setQuickDocFontSize(FontSize.values()[myFontSizeSlider.getValue()]); applyFontSize(); } }); String tooltipText = ApplicationBundle.message("quickdoc.tooltip.font.size.by.wheel"); result.setToolTipText(tooltipText); myFontSizeSlider.setToolTipText(tooltipText); result.setVisible(false); result.setOpaque(true); myFontSizeSlider.setOpaque(true); return result; }
private JComponent createAddPrefixComponent(final SourceFolder folder) { final IconActionComponent iconComponent = new IconActionComponent( ADD_PREFIX_ICON, ADD_PREFIX_ROLLOVER_ICON, ProjectBundle.message("module.paths.package.prefix.tooltip"), new Runnable() { public void run() { final String message = ProjectBundle.message( "module.paths.package.prefix.prompt", toRelativeDisplayPath(folder.getUrl(), getContentEntry().getUrl() + ":")); final String prefix = Messages.showInputDialog( JavaContentRootPanel.this, message, ProjectBundle.message("module.paths.package.prefix.title"), Messages.getQuestionIcon(), folder.getPackagePrefix(), null); if (prefix != null) { myCallback.setPackagePrefix(folder, prefix); } } }); final JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.add(iconComponent, BorderLayout.CENTER); panel.add(Box.createHorizontalStrut(3), BorderLayout.EAST); return panel; }
public void buildNorth() { title.setFont(titleFont); list.add(0, "Select Planet"); list.add(1, "Mercury"); list.add(2, "Venus"); list.add(3, "Earth"); list.add(4, "Mars"); list.add(5, "Asteroids"); list.add(6, "Jupiter"); list.add(7, "Saturn"); list.add(8, "Uranus"); list.add(9, "Neptune"); list.add(10, "Pluto"); ImageIcon fig = new ImageIcon(getImage(getCodeBase(), "Images/ss.jpg")); display = new JLabel(fig); factChoice.addItem("Select Fact"); factChoice.addItem("Volume"); factChoice.addItem("Surface Area"); factChoice.addItem("Density"); factChoice.addItem("Temperature"); factChoice.addItem("Distance From Earth"); factChoice.addItem("Diameter"); pNorth1.setOpaque(false); pNorth2.setOpaque(false); pNorth3.setOpaque(false); pNorth4.setOpaque(false); pNorth5.setOpaque(false); moons.setOpaque(false); whatUnits.setOpaque(false); add("North", pNorth1); pNorth1.add(pNorth2); pNorth2.add(planets); pNorth1.add(display); pNorth1.add(pNorth3); pNorth3.add("North", factChoice); pNorth3.add("Center", pNorth4); pNorth4.add(moons); pNorth4.add(whatUnits); pNorth3.add("South", pNorth5); pNorth5.add(fact); pNorth5.add(units); pNorth5.add(select); pNorth5.add(clear); }
public InfoAndProgressPanel() { setOpaque(false); myRefreshIcon = new RefreshFileSystemIcon(); // new AsyncProcessIcon("Refreshing filesystem") { // protected Icon getPassiveIcon() { // return myEmptyRefreshIcon; // } // // @Override // public Dimension getPreferredSize() { // if (!isRunning()) return new Dimension(0, 0); // return super.getPreferredSize(); // } // // @Override // public void paint(Graphics g) { // g.translate(0, -1); // super.paint(g); // g.translate(0, 1); // } // }; myRefreshIcon.setPaintPassiveIcon(false); myRefreshAndInfoPanel.setLayout(new BorderLayout()); myRefreshAndInfoPanel.setOpaque(false); myRefreshAndInfoPanel.add(myRefreshIcon, BorderLayout.WEST); myRefreshAndInfoPanel.add(myInfoPanel, BorderLayout.CENTER); myProgressIcon = new AsyncProcessIcon("Background process"); myProgressIcon.setOpaque(false); myProgressIcon.addMouseListener( new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { handle(e); } @Override public void mouseReleased(MouseEvent e) { handle(e); } }); myProgressIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); myProgressIcon.setBorder(StatusBarWidget.WidgetBorder.INSTANCE); myProgressIcon.setToolTipText(ActionsBundle.message("action.ShowProcessWindow.double.click")); myUpdateQueue = new MergingUpdateQueue("Progress indicator", 50, true, MergingUpdateQueue.ANY_COMPONENT); myPopup = new ProcessPopup(this); setRefreshVisible(false); restoreEmptyStatus(); }
private void showAlignment() { int[] selRows = dataTable.getSelectedRows(); for (int row : selRows) { AbstractPartitionData partition = options.dataPartitions.get(row); Alignment alignment = null; if (partition instanceof PartitionData) alignment = ((PartitionData) partition).getAlignment(); // alignment == null if partition is trait or microsat // http://code.google.com/p/beast-mcmc/issues/detail?id=343 if (alignment == null) { JOptionPane.showMessageDialog( this, "Cannot display traits or microsatellite data currently.\nUse the traits panel to view and edit traits.", "Illegal Argument Exception", JOptionPane.ERROR_MESSAGE); return; } JFrame frame = new JFrame(); frame.setSize(800, 600); AlignmentViewer viewer = new AlignmentViewer(); if (alignment.getDataType().getType() == DataType.NUCLEOTIDES) { viewer.setCellDecorator(new StateCellDecorator(new NucleotideDecorator(), false)); } else if (alignment.getDataType().getType() == DataType.AMINO_ACIDS) { viewer.setCellDecorator(new StateCellDecorator(new AminoAcidDecorator(), false)); } else { // no colouring } viewer.setAlignmentBuffer(new BeautiAlignmentBuffer(alignment)); JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.add(viewer, BorderLayout.CENTER); JPanel infoPanel = new JPanel(new BorderLayout()); infoPanel.setOpaque(false); panel.add(infoPanel, BorderLayout.SOUTH); frame.setContentPane(panel); frame.setVisible(true); } }
private void populateTournamentActive() { lblTitle.setText( "Quest Mode: Draft Tournament - " + FModel.getQuest().getAchievements().getCurrentDraft().getTitle()); VHomeUI.SINGLETON_INSTANCE .getPnlDisplay() .setLayout(new MigLayout("insets 0, gap 0, ax center, wrap 1")); VHomeUI.SINGLETON_INSTANCE .getPnlDisplay() .add(lblTitle, "w 80%!, h 40px!, gap 20% 0 15px 10px, ax right, span 2"); FScrollPanel panel = new FScrollPanel( new MigLayout("insets 0, gap 0, wrap 4, ax center"), true, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); String constraintsLeft = "w 350px!, h 196px!, gap 0px 0px 0px 0px, ay center"; String constraintsMiddle = "w 350px!, h 392px!, gap 0px 0px 0px 0px, ay center"; String constraintsRight = "w 350px!, h 784px!, gap 0px 0px 0px 0px, ay center"; panel.add(matchups[0], constraintsLeft); panel.add(matchups[4], constraintsMiddle + ", span 1 2"); panel.add(matchups[6], constraintsRight + ", span 1 4"); panel.add(matchups[7], constraintsRight + ", span 1 4"); panel.add(matchups[1], constraintsLeft); panel.add(matchups[2], constraintsLeft); panel.add(matchups[5], constraintsMiddle + ", span 1 2"); panel.add(matchups[3], constraintsLeft); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(panel, "gap 0 0 0 0, ax center"); btnEditDeck.setFontSize(12); JPanel bottomButtons = new JPanel(new MigLayout("insets 0, gap 0, wrap 2, ax center")); if (FModel.getQuest().getAchievements().getCurrentDraft().playerHasMatchesLeft()) { VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnStartMatch, "gap 0 0 0 20px, ax center"); bottomButtons.add(btnEditDeck, "w 135px!, h 25px!, gap 0 25px 10px 10px, ax right"); bottomButtons.add(btnLeaveTournament, "w 135px!, h 25px!, gap 25px 0 10px 10px, ax right"); btnLeaveTournament.setFontSize(12); } else { VHomeUI.SINGLETON_INSTANCE .getPnlDisplay() .add(btnLeaveTournament, "w 250px!, h 60px!, gap 0 0 20px 20px, ax center"); bottomButtons.add(btnEditDeck, "w 135px!, h 25px!, gap 0 25px 10px 10px, ax right"); bottomButtons.add(btnStartMatchSmall, "w 135px!, h 25px!, gap 25px 0 10px 10px, ax right"); btnLeaveTournament.setFontSize(24); } VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(bottomButtons, "w 100%!"); bottomButtons.setOpaque(false); }
private JPanel getRow(int gap, Component comp1, Component comp2) { JPanel panel = new JPanel(new BorderLayout(gap, 0)); panel.setOpaque(false); panel.add(comp1, BorderLayout.CENTER); panel.add(comp2, BorderLayout.EAST); return panel; }
public CompoundTreeCellRenderer() { super(); Color bsColor = getBorderSelectionColor(); Color focusBGColor = new Color(~getBackgroundSelectionColor().getRGB()); hasFocusBorder = BorderFactory.createCompoundBorder(new DotBorder(focusBGColor, bsColor), innerBorder); icon.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2)); text.setBorder(emptyBorder); text.setOpaque(true); p.setOpaque(false); p.add(icon, BorderLayout.WEST); JPanel wrap = new JPanel(new GridBagLayout()); wrap.setOpaque(false); wrap.add(text); p.add(wrap); }
private JPanel createPanel(int index, Component... components) { JPanel p = new JPanel(); p.setLayout(new BorderLayout()); p.setOpaque(false); if (index >= components.length) return p; p.add(components[index], BorderLayout.WEST); p.add(createPanel(index + 1, components), BorderLayout.CENTER); return p; }