public PanelSpec(SmedAction dia) { dlg = dia; setLayout(null); add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP)); add(getShapeButton(sparButton, 34, 0, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP)); add(getShapeButton(canButton, 68, 0, 34, 32, "Can", Shp.CAN, Obj.BOYSPP)); add(getShapeButton(coneButton, 102, 0, 34, 32, "Cone", Shp.CONI, Obj.BOYSPP)); add(getShapeButton(sphereButton, 0, 32, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYSPP)); add(getShapeButton(barrelButton, 34, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP)); add(getShapeButton(superButton, 68, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP)); add(getShapeButton(floatButton, 102, 32, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT)); add(getShapeButton(beaconButton, 0, 64, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP)); add(getShapeButton(towerButton, 34, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNSPP)); add(getShapeButton(stakeButton, 68, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP)); add(getShapeButton(cairnButton, 102, 64, 34, 32, "CairnB", Shp.CAIRN, Obj.BCNSPP)); categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER); categoryLabel.setBounds(new Rectangle(5, 125, 160, 18)); add(categoryLabel); categoryBox = new JComboBox(); categoryBox.setBounds(new Rectangle(5, 142, 160, 18)); add(categoryBox); categoryBox.setVisible(true); categoryBox.addActionListener(alCategoryBox); addCatItem("", Cat.NOCAT); addCatItem(Messages.getString("UKPurpose"), Cat.SPM_UNKN); addCatItem(Messages.getString("Warning"), Cat.SPM_WARN); addCatItem(Messages.getString("ChanSeparation"), Cat.SPM_CHBF); addCatItem(Messages.getString("Yachting"), Cat.SPM_YCHT); addCatItem(Messages.getString("Cable"), Cat.SPM_CABL); addCatItem(Messages.getString("Outfall"), Cat.SPM_OFAL); addCatItem(Messages.getString("ODAS"), Cat.SPM_ODAS); addCatItem(Messages.getString("RecreationZone"), Cat.SPM_RECN); addCatItem(Messages.getString("Mooring"), Cat.SPM_MOOR); addCatItem(Messages.getString("LANBY"), Cat.SPM_LNBY); addCatItem(Messages.getString("Leading"), Cat.SPM_LDNG); addCatItem(Messages.getString("Notice"), Cat.SPM_NOTC); addCatItem(Messages.getString("TSS"), Cat.SPM_TSS); addCatItem(Messages.getString("FoulGround"), Cat.SPM_FOUL); addCatItem(Messages.getString("Diving"), Cat.SPM_DIVE); addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY); addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH); mooringBox = new JComboBox(); mooringBox.setBounds(new Rectangle(5, 142, 160, 18)); add(mooringBox); mooringBox.setVisible(false); mooringBox.addActionListener(alMooringBox); addMorItem("", Cat.NOCAT); addMorItem(Messages.getString("Dolphin"), Cat.MOR_DLPN); addMorItem(Messages.getString("DevDolphin"), Cat.MOR_DDPN); addMorItem(Messages.getString("Bollard"), Cat.MOR_BLRD); addMorItem(Messages.getString("Wall"), Cat.MOR_WALL); addMorItem(Messages.getString("Post"), Cat.MOR_POST); addMorItem(Messages.getString("Chain"), Cat.MOR_CHWR); addMorItem(Messages.getString("Rope"), Cat.MOR_ROPE); addMorItem(Messages.getString("Automatic"), Cat.MOR_AUTO); addMorItem(Messages.getString("MooringBuoy"), Cat.MOR_BUOY); addMorItem(Messages.getString("CALM"), Cat.INB_CALM); addMorItem(Messages.getString("SBM"), Cat.INB_SBM); topmarkButton.setBounds(new Rectangle(136, 0, 34, 32)); topmarkButton.setToolTipText(Messages.getString("Topmark")); topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder()); topmarkButton.addActionListener(alTop); add(topmarkButton); // noticeButton.setBounds(new Rectangle(136, 32, 34, 32)); // noticeButton.setToolTipText(Messages.getString("Notice")); // noticeButton.setBorder(BorderFactory.createLoweredBevelBorder()); // noticeButton.addActionListener(alNotice); // add(noticeButton); mooringButton.setBounds(new Rectangle(136, 64, 34, 32)); mooringButton.setToolTipText(Messages.getString("Mooring")); mooringButton.setBorder(BorderFactory.createLoweredBevelBorder()); mooringButton.addActionListener(alMooring); add(mooringButton); }
public JMovieControlAqua() { // Set the background color to the border color of the buttons. // This way the toolbar won't look too ugly when the buttons // are displayed before they have been loaded completely. // setBackground(new Color(118, 118, 118)); setBackground(Color.WHITE); Dimension buttonSize = new Dimension(16, 16); GridBagLayout gridbag = new GridBagLayout(); Insets margin = new Insets(0, 0, 0, 0); setLayout(gridbag); GridBagConstraints c; ResourceBundle labels = ResourceBundle.getBundle("org.monte.media.Labels"); colorCyclingButton = new JToggleButton(); colorCyclingButton.setToolTipText(labels.getString("colorCycling.toolTipText")); colorCyclingButton.addActionListener(this); colorCyclingButton.setPreferredSize(buttonSize); colorCyclingButton.setMinimumSize(buttonSize); colorCyclingButton.setVisible(false); colorCyclingButton.setMargin(margin); c = new GridBagConstraints(); // c.gridx = 0; // c.gridy = 0; gridbag.setConstraints(colorCyclingButton, c); add(colorCyclingButton); audioButton = new JToggleButton(); audioButton.setToolTipText(labels.getString("audio.toolTipText")); audioButton.addActionListener(this); audioButton.setPreferredSize(buttonSize); audioButton.setMinimumSize(buttonSize); audioButton.setVisible(false); audioButton.setMargin(margin); c = new GridBagConstraints(); // c.gridx = 0; // c.gridy = 0; gridbag.setConstraints(audioButton, c); add(audioButton); startButton = new JToggleButton(); startButton.setToolTipText(labels.getString("play.toolTipText")); startButton.addActionListener(this); startButton.setPreferredSize(buttonSize); startButton.setMinimumSize(buttonSize); startButton.setMargin(margin); c = new GridBagConstraints(); // c.gridx = 1; // c.gridy = 0; gridbag.setConstraints(startButton, c); add(startButton); slider = new JMovieSliderAqua(); c = new GridBagConstraints(); // c.gridx = 2; // c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; gridbag.setConstraints(slider, c); add(slider); rewindButton = new JButton(); rewindButton.setToolTipText(labels.getString("previous.toolTipText")); rewindButton.setPreferredSize(buttonSize); rewindButton.setMinimumSize(buttonSize); rewindButton.setMargin(margin); c = new GridBagConstraints(); // c.gridx = 3; // c.gridy = 0; gridbag.setConstraints(rewindButton, c); add(rewindButton); rewindButton.addActionListener(this); forwardButton = new JButton(); forwardButton.setToolTipText(labels.getString("next.toolTipText")); buttonSize = new Dimension(17, 16); forwardButton.setPreferredSize(buttonSize); forwardButton.setMinimumSize(buttonSize); forwardButton.setMargin(margin); c = new GridBagConstraints(); // c.gridx = 4; // c.gridy = 0; gridbag.setConstraints(forwardButton, c); add(forwardButton); forwardButton.addActionListener(this); // The spacer is used when the play controls are hidden spacer = new JPanel(new BorderLayout()); spacer.setVisible(false); spacer.setPreferredSize(new Dimension(16, 16)); spacer.setMinimumSize(new Dimension(16, 16)); spacer.setOpaque(false); c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; gridbag.setConstraints(spacer, c); add(spacer); Border border = new BackdropBorder( new ButtonStateBorder( new ImageBevelBorder( Images.createImage(getClass(), "images/Player.border.png"), new Insets(1, 1, 1, 1), new Insets(0, 4, 1, 4)), new ImageBevelBorder( Images.createImage(getClass(), "images/Player.borderP.png"), new Insets(1, 1, 1, 1), new Insets(0, 4, 1, 4)))); Border westBorder = new BackdropBorder( new ButtonStateBorder( new ImageBevelBorder( Images.createImage(getClass(), "images/Player.borderWest.png"), new Insets(1, 1, 1, 0), new Insets(0, 4, 1, 4)), new ImageBevelBorder( Images.createImage(getClass(), "images/Player.borderWestP.png"), new Insets(1, 1, 1, 0), new Insets(0, 4, 1, 4)))); startButton.setBorder(westBorder); colorCyclingButton.setBorder(westBorder); audioButton.setBorder(westBorder); rewindButton.setBorder(westBorder); forwardButton.setBorder(border); startButton.setUI((ButtonUI) CustomButtonUI.createUI(startButton)); colorCyclingButton.setUI((ButtonUI) CustomButtonUI.createUI(audioButton)); audioButton.setUI((ButtonUI) CustomButtonUI.createUI(audioButton)); rewindButton.setUI((ButtonUI) CustomButtonUI.createUI(rewindButton)); forwardButton.setUI((ButtonUI) CustomButtonUI.createUI(forwardButton)); colorCyclingButton.setIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStartColorCycling.png"))); colorCyclingButton.setSelectedIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStartColorCycling.png"))); colorCyclingButton.setDisabledIcon( new ImageIcon( Images.createImage(getClass(), "images/PlayerStartColorCycling.disabled.png"))); audioButton.setIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStartAudio.png"))); audioButton.setSelectedIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStopAudio.png"))); audioButton.setDisabledIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStartAudio.disabled.png"))); startButton.setIcon(new ImageIcon(Images.createImage(getClass(), "images/PlayerStart.png"))); startButton.setSelectedIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStop.png"))); startButton.setDisabledIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerStart.disabled.png"))); rewindButton.setIcon(new ImageIcon(Images.createImage(getClass(), "images/PlayerBack.png"))); rewindButton.setDisabledIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerBack.disabled.png"))); forwardButton.setIcon(new ImageIcon(Images.createImage(getClass(), "images/PlayerNext.png"))); forwardButton.setDisabledIcon( new ImageIcon(Images.createImage(getClass(), "images/PlayerNext.disabled.png"))); // Automatic scrolling scrollHandler = new ScrollHandler(); scrollTimer = new Timer(60, scrollHandler); scrollTimer.setInitialDelay(300); // default InitialDelay? forwardButton.addMouseListener(scrollHandler); rewindButton.addMouseListener(scrollHandler); }
public void jbInit() throws Exception { this.setLayout(null); fContractPriceTextField.setFont(new java.awt.Font("Dialog", 1, 11)); fContractPriceTextField.setDisabledTextColor(Color.black); fContractPriceTextField.setEditable(false); fContractPriceTextField.setHorizontalAlignment(SwingConstants.RIGHT); fContractPriceTextField.setBounds(new java.awt.Rectangle(285, 182, 55, 21)); fContractVolumeTextField.setFont(new java.awt.Font("Dialog", 1, 11)); fContractVolumeTextField.setDisabledTextColor(Color.black); fContractVolumeTextField.setEditable(false); fContractVolumeTextField.setHorizontalAlignment(SwingConstants.RIGHT); fContractVolumeTextField.setBounds(new java.awt.Rectangle(285, 238, 55, 21)); fContractVolumeLabel.setText(fRb.getString("CONTRACT_VOLUME")); fContractVolumeLabel.setForeground(Color.black); fContractVolumeLabel.setBounds(new java.awt.Rectangle(272, 218, 99, 17)); fContractPriceLabel.setBounds(new java.awt.Rectangle(272, 160, 92, 17)); fContractPriceLabel.setText(fRb.getString("CONTRACT_PRICE")); fContractPriceLabel.setForeground(Color.black); fBoardGraph.setLayout(borderLayout1); fDay.setBounds(new java.awt.Rectangle(337, 87, 42, 21)); fDayLabel.setText(fRb.getString("DAY") + ":"); fDayLabel.setForeground(Color.black); fDayLabel.setBounds(new java.awt.Rectangle(267, 89, 67, 17)); fBoardLabel.setText(fRb.getString("SESSION") + ":"); fBoardLabel.setForeground(Color.black); fBoardLabel.setBounds(new java.awt.Rectangle(267, 121, 68, 17)); fBoard.setBounds(new java.awt.Rectangle(337, 119, 42, 22)); fPreviousBoardLabel.setFont(new java.awt.Font("Dialog", 1, 12)); fPreviousBoardLabel.setText(fRb.getString("PREVIOUS_PRICING")); fPreviousBoardLabel.setForeground(Color.black); fPreviousBoardLabel.setBounds(new java.awt.Rectangle(85, 4, 99, 17)); fXYToggleButton.setBorder(BorderFactory.createRaisedBevelBorder()); fXYToggleButton.setText("Exchange X-Y"); fXYToggleButton.setBounds(new java.awt.Rectangle(268, 43, 114, 25)); fXYToggleButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { fIsExchangeXY = fXYToggleButton.isSelected(); fIsUpdated = true; gUpdate(); } }); this.setBorder(BorderFactory.createEtchedBorder()); this.setBounds(new java.awt.Rectangle(325, 7, 387, 283)); this.setLayout(null); fBoardGraph.setBorder(BorderFactory.createEtchedBorder()); fBoardGraph.setBounds(new java.awt.Rectangle(5, 26, 257, 243)); fBoardGraph.getGraph().add(new UGraphData(fSellName, fSellColor)); fBoardGraph.getGraph().add(new UGraphData(fBuyName, fBuyColor)); fBoardGraph.setLeftMargin(60); this.add(fBoardGraph, null); this.add(fContractVolumeTextField, null); this.add(fContractVolumeLabel, null); this.add(fContractPriceTextField, null); this.add(fContractPriceLabel, null); this.add(fBoardLabel, null); this.add(fDayLabel, null); this.add(fXYToggleButton, null); this.add(fPreviousBoardLabel, null); this.add(fDay, null); this.add(fBoard, null); fBoardGraph.setBackground(Color.white); fBoardGraph.setNumOfHorizontalLine(0); fBoardGraph.setNumOfVerticalLine(0); fBoardGraph.setFixedMaxX(1); fBoardGraph.setFixedMinX(0); fBoardGraph.setFixedMaxY(1); fBoardGraph.setFixedMinY(0); addComponentListener( new ComponentAdapter() { public void componentShown(ComponentEvent ce) { gUpdate(); } }); }