public void addActionListener(final ActionListener _l) { if (btNavValider_ != null) { btNavValider_.addActionListener(_l); } if (btNavFermer_ != null) { btNavFermer_.addActionListener(_l); } if (btNavPrecedent_ != null) { btNavPrecedent_.addActionListener(_l); } if (btNavSuivant_ != null) { btNavSuivant_.addActionListener(_l); } if (btNavTerminer_ != null) { btNavTerminer_.addActionListener(_l); } } public void removeActionListener(final ActionListener _l) {
/** * Construit un bouton ayant comme label <code>_text</code> et comme "ActionCommand" <code>_action</code>. */ protected JButton construireBuButton(final String _text, final String _action) { final BuButton r = new BuButton(_text); r.setActionCommand(_action); r.addActionListener(this); return r; }
public BuButton addCustomButton(final String _label, final BuIcon _icon, final String _cmd) { final BuButton btNew = new BuButton(_icon, _label); btNew.setActionCommand(_cmd); btNew.setName("bt" + _cmd); add(btNew); btCustom_.add(btNew); for (int i = 0; i < listeners_.size(); i++) { btNew.addActionListener((ActionListener) listeners_.get(i)); } return btNew; }
protected BuButton[] getButtons() { btCopier_ =new BuButton(BuResource.BU.loadButtonCommandIcon("COPIER"), _("Copier")); btContinuer_=new BuButton(BuResource.BU.loadButtonCommandIcon("CONTINUER"), _("Continuer")); btCopier_ .addActionListener(this); btContinuer_.addActionListener(this); return new BuButton[] { btCopier_,btContinuer_ }; }
public BSelecteurColorChooser(final String _prop,final BuButton[] _bt) { super(_prop); pn_ = new BuPanel(); pn_.setLayout(new BuBorderLayout()); chooser_ = new JColorChooser(); pn_.add(chooser_, BuBorderLayout.CENTER); final JPanel pb = new BuPanel(); pb.setLayout(new BuButtonLayout()); apply_ = new BuButton(BuResource.BU.getToolIcon("appliquer")); apply_.addActionListener(this); pn_.add(pb, BuBorderLayout.SOUTH); pb.add(apply_); if (_bt != null) { for (int i = 0; i < _bt.length; i++) { pb.add(_bt[i]); } } }
public void buildPanel() { if (pn_ != null) { return; } pn_ = new BuPanel(); pn_.setLayout(new BuHorizontalLayout(3)); chbEnable_ = new BuCheckBox(); cbMode_ = new BuComboBox(new String[] { "Modulate", "Decal", "Blend", "Replace" }); btFileChooser_ = new BuButton(); setBtDefaultTltip(); chbEnable_.addActionListener(this); btFileChooser_.addActionListener(this); setNoneIcone(); cbMode_.addItemListener(this); pn_.add(chbEnable_); pn_.add(btFileChooser_); pn_.add(cbMode_); updateSrc(); }
public BSelecteurFont(final String _property) { super(_property); setTitle(EbliLib.getS("Fonte")); bt_.setText(EbliLib.getS("Choisir la fonte")); bt_.addActionListener(this); }
public BPaletteTexture() { super(); //layout_=new GridLayout(5, nb/5+((nb%5)==0?0:1)); final Icon[] icones= TraceSurface.getIcones(); final int nb= icones.length; setLayout(new GridLayout(5, nb / 5 + ((nb % 5) == 0 ? 0 : 1))); for (int i= nb - 1; i >= 0; i--) { final BuButton tmp= new BuButton(); tmp.setToolTipText((String)TraceSurface.TEXTURE_NOM.get(i)); tmp.setActionCommand("" + i); tmp.setIcon(icones[i]); tmp.addActionListener(this); add(tmp); } } /* for(int i=0; i<boutons_.length; i++) {
public BuPreferencesDialog(Frame _parent, BuPreferencesMainPanel _p) { super(_parent); setModal(true); if (_p != null) { setContentPane(_p); _p.getFermerButton().addActionListener(this); this.getRootPane().setDefaultButton(_p.getValiderButton()); setTitle(BuResource.BU.getString("Prfrences de dmarrage")); } pack(); }
public BuDialogMessage(BuCommonInterface _parent, BuInformationsSoftware _isoft, Object _message) { super(_parent,_isoft,__("Message"),_message); BuPanel pnb=new BuPanel(); pnb.setLayout(new BuButtonLayout()); //new FlowLayout(FlowLayout.RIGHT)); btContinuer_=new BuButton(BuResource.BU.loadButtonCommandIcon("CONTINUER"), _("Continuer")); btContinuer_.addActionListener(this); pnb.add(btContinuer_); getRootPane().setDefaultButton(btContinuer_); content_.add(pnb,BuBorderLayout.SOUTH); }
public BuDialogConfirmation(BuCommonInterface _parent, BuInformationsSoftware _isoft, Object _message) { super(_parent,_isoft,__("Confirmation"),_message); BuPanel pnb=new BuPanel(); pnb.setLayout(new BuButtonLayout()); //new FlowLayout(FlowLayout.RIGHT)); btOui_=new BuButton(BuResource.BU.loadButtonCommandIcon("OUI"), _("Oui")); btOui_.addActionListener(this); pnb.add(btOui_); btNon_=new BuButton(BuResource.BU.loadButtonCommandIcon("NON"), _("Non")); btNon_.addActionListener(this); getRootPane().setDefaultButton(btNon_); pnb.add(btNon_); content_.add(pnb,BuBorderLayout.SOUTH); }
public BuDialogReplace(BuCommonInterface _parent, BuInformationsSoftware _isoft, BuTextComponentInterface _texte) { super(_parent,_isoft,__("Remplacement")); tcTexte_=_texte; BuPanel pnb=new BuPanel(); pnb.setLayout(new BuButtonLayout()); //new FlowLayout(FlowLayout.RIGHT)); btRemplacer_=new BuButton(BuResource.BU.loadButtonCommandIcon("REMPLACER"), _("Remplacer")); btRemplacer_.addActionListener(this); getRootPane().setDefaultButton(btRemplacer_); pnb.add(btRemplacer_); btFermer_=new BuButton(BuResource.BU.loadButtonCommandIcon("QUITTER"), _("Fermer")); btFermer_.addActionListener(this); pnb.add(btFermer_); content_.add(pnb,BuBorderLayout.SOUTH); }
public BuDialogFind(BuCommonInterface _parent, BuInformationsSoftware _isoft, BuTextComponentInterface _texte) { super(_parent,_isoft,__("Recherche")); tcTexte_=_texte; BuPanel pnb=new BuPanel(); pnb.setLayout(new BuButtonLayout()); //new FlowLayout(FlowLayout.RIGHT)); btRechercher_=new BuButton(BuResource.BU.loadButtonCommandIcon("RECHERCHER"), _("Rechercher")); btRechercher_.addActionListener(this); getRootPane().setDefaultButton(btRechercher_); pnb.add(btRechercher_); btFermer_=new BuButton(BuResource.BU.loadButtonCommandIcon("QUITTER"), _("Fermer")); btFermer_.addActionListener(this); pnb.add(btFermer_); content_.add(pnb,BuBorderLayout.SOUTH); }
public CtuluFileChooserPanel(final File _initDir, final String _title) { super(); initDir_ = _initDir; tf_ = new BuTextField(); tf_.setColumns(30); tf_.getDocument().addDocumentListener(this); setLayout(new BuBorderLayout()); add(tf_, BuBorderLayout.CENTER); bt_ = new BuButton(); bt_.setHorizontalAlignment(SwingConstants.RIGHT); bt_.setName(_title); bt_.setHorizontalTextPosition(SwingConstants.CENTER); bt_.setText("..."); bt_.setToolTipText(CtuluLib.getS("Modifier le chemin du fichier")); bt_.addActionListener(this); add(bt_, BuBorderLayout.EAST); }
public DjaPaletteLink(ActionListener _al) { super(); layout_=new BuGridLayout(4,2,2); layout_.setCfilled(false); setLayout(layout_); setBorder(new EmptyBorder(2,2,2,2)); buttons_=new BuButton[names.length]; for(int i=0; i<buttons_.length; i++) { BuIcon icon=DjaResource.DJA.getIcon("dja-"+icons[i],16); buttons_[i]=new BuButton(); buttons_[i].setIcon(icon); buttons_[i].setMargin(new Insets(1,1,1,1)); buttons_[i].setRequestFocusEnabled(false); buttons_[i].setToolTipText( /* "Create a "+ */ names[i].toLowerCase()); buttons_[i].setActionCommand("DJA_CREATE_LINK("+names[i]+")"); add(buttons_[i]); buttons_[i].addActionListener(_al); } } }
public DjaPaletteStroke(ActionListener _al) { super(); layout_=new BuGridLayout(4,2,2); layout_.setCfilled(false); setLayout(layout_); setBorder(new EmptyBorder(2,2,2,2)); buttons_=new BuButton[names.length]; for(int i=0; i<buttons_.length; i++) { Icon icon=new StrokeIcon(names[i]); buttons_[i]=new BuButton(); buttons_[i].setIcon(icon); buttons_[i].setRolloverIcon(icon); buttons_[i].setMargin(new Insets(1,1,1,1)); buttons_[i].setRequestFocusEnabled(false); buttons_[i].setToolTipText(/* "Set stroke to "+ */ names[i]); buttons_[i].setActionCommand("DJA_STROKE("+names[i]+")"); add(buttons_[i]); buttons_[i].addActionListener(_al); } }
public DjaPaletteThickness(ActionListener _al) { super(); layout_=new BuGridLayout(4,2,2); layout_.setCfilled(false); setLayout(layout_); setBorder(new EmptyBorder(2,2,2,2)); buttons_=new BuButton[8]; for(int i=0; i<8; i++) { Icon icon=new ThicknessIcon(i+1); buttons_[i]=new BuButton(); buttons_[i].setIcon(icon); buttons_[i].setRolloverIcon(icon); buttons_[i].setMargin(new Insets(1,1,1,1)); buttons_[i].setRequestFocusEnabled(false); buttons_[i].setToolTipText(/* "Set thickness to "+ */ ""+(i+1)); buttons_[i].setActionCommand("DJA_THICKNESS("+(i+1)+")"); add(buttons_[i]); buttons_[i].addActionListener(_al); } }
public FudaaDjaPaletteForm(FudaaDjaGrid _grid) { super(); grid_ = _grid; layout_ = new BuGridLayout(4, 2, 2); layout_.setCfilled(false); setLayout(layout_); setBorder(new EmptyBorder(2, 2, 2, 2)); buttons_ = new BuButton[names_.length]; for (int i = 0; i < buttons_.length; i++) { BuIcon icon = DjaResource.DJA.getIcon("dja-" + names_[i].getDjaName().toLowerCase(), 16); buttons_[i] = new BuButton(); buttons_[i].setIcon(icon); buttons_[i].setMargin(new Insets(1, 1, 1, 1)); buttons_[i].setRequestFocusEnabled(false); buttons_[i].setToolTipText("<html><body>" + FudaaLib.getS("Ajouter:") + "<br>" + names_[i].getDescription()); buttons_[i].setActionCommand("DJA_CREATE_FORM(" + names_[i] + ')'); buttons_[i].putClientProperty("DJA_TARGET", names_[i]); add(buttons_[i]); buttons_[i].addActionListener(this); } }
/** * Liste les serveurs. */ public void listeServeur() { pnMain_.removeAll(); setTitle("Liste des serveurs Dodico-1"); final BuGridLayout glayout= new BuGridLayout(2, 5, 5, false, false, false, false); glayout.setXAlign(LEFT_ALIGNMENT); pnMain_.setLayout(glayout); final String[] r= moteur_.listeServeur(); for (int i= 0; i < r.length; i++) { pnMain_.add(new BuLabel(r[i])); final BuButton bt= new BuButton("etat"); bt.setActionCommand("ETAT:" + i); bt.addActionListener(this); pnMain_.add(bt); } pack(); pnMain_.repaint(); } /**
public JComponent buildContentPane() { BuPanel pn = new BuPanel(new BuBorderLayout()); BuList l = new BuList(controller_.getFrameListModel()); l.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); l.setCellRenderer(FudaaLib.createInternalFrameCellRenderer()); pn.add(new BuScrollPane(l)); final ActionListener action = createActionForList(l); l.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent _e) { if (_e.getClickCount() == 2) { action.actionPerformed(null); } } }); BuButton bt = new BuButton(BuResource.BU.getString("Ajouter")); bt.addActionListener(action); pn.add(bt, BuBorderLayout.SOUTH); return pn; }