/** * Constructeur avec prcision des 2 boutons. * @param _buttonTrue Le bouton du haut droite, si null radio bouton "oui". * @param _buttonFalse Le bouton du bas droite, si null radio bouton "non". */ public EbliButtonYesNo(final AbstractButton _buttonTrue, final AbstractButton _buttonFalse) { this(new BuLabel(CtuluLibString.EMPTY_STRING), _buttonTrue, _buttonFalse); }
protected BuLabel addRedLabel(final Container _c) { final BuLabel r = new BuLabel(); r.setForeground(Color.red); _c.add(r); return r; }
public BuLabel(String _label, Icon _icon, int _halign, int _valign) { super(); setText(_label); setIcon(_icon); setHorizontalAlignment(_halign); setVerticalAlignment(_valign); }
private BuPanel createPreviewPanel() { final BuPanel center = new BuPanel(new BuGridLayout(2, 2, 2)); center.setBorder(CtuluLibSwing.createTitleBorder(CtuluLib.getS("Exemples"))); for (int i = 0; i < values_.length; i++) { final BuLabel lb = new BuLabel(values_[i].toString()); center.add(lb); label_[i] = new BuLabel(); center.add(label_[i]); label_[i].setBackground(Color.WHITE); lb.setBackground(Color.WHITE); lb.setHorizontalTextPosition(SwingConstants.RIGHT); lb.setHorizontalAlignment(SwingConstants.RIGHT); lb.setOpaque(true); label_[i].setOpaque(true); label_[i].setHorizontalTextPosition(SwingConstants.CENTER); label_[i].setHorizontalAlignment(SwingConstants.RIGHT); } return center; }
/** * initialise tous les labels qui afficheront des donnees. La couleur de font est blanche, le texte est aligne a * droite et une bordure est ajoutee. */ static final BuLabel initBuLabelDonnee() { final BuLabel r = new BuLabel(); r.setBackground(Color.white); r.setOpaque(true); r.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder( 2, 2, 2, 2))); r.setHorizontalAlignment(SwingConstants.RIGHT); return r; }
final Dimension de = app.getToolkit().getScreenSize(); final BuLabel label = new BuLabel(); final BuButton button = new BuButton(); final BuPanel top = new BuPanel(); label.setText(app.getTitle() + ": " + frame.getTitle()); label.setBorder(BuBorders.EMPTY1111); label.setHorizontalAlignment(SwingConstants.CENTER); top.add(label, BorderLayout.CENTER);
super.setBackground(((JList)_comp).getSelectionBackground()); super.setForeground(((JList)_comp).getSelectionForeground()); super.setBackground(UIManager.getColor("Tree.selectionBackground")); super.setForeground(UIManager.getColor("Tree.selectionForeground")); super.setBackground(((JTable)_comp).getSelectionBackground()); super.setForeground(((JTable)_comp).getSelectionForeground()); super.setBackground(_comp.getBackground()); super.setForeground(_comp.getForeground()); super.setText(((JTree)_comp).convertValueToText (_value,_selected,_expanded,_leaf,_row,_focus)); if(_leaf ) super.setIcon(UIManager.getIcon("Tree.leafIcon" )); else if(_expanded) super.setIcon(UIManager.getIcon("Tree.openIcon" )); else super.setIcon(UIManager.getIcon("Tree.closedIcon")); super.setText(""+_value); super.setOpaque(true); super.setEnabled(_comp.isEnabled()); super.setFont(_comp.getFont()); super.setBorder (_focus ? UIManager.getBorder((_comp instanceof JTable)
(_table,_value,selected,_focus,_row,_column); Font ft=r.getFont(); Color bg=r.getBackground(); Color fg=r.getForeground(); int a =LEFT;//r.getHorizontalAlignment(); String t =""; //r.getText(); r.setFont(ft); r.setForeground(fg); r.setBackground(bg); r.setHorizontalAlignment(a); r.setText(t); r.setIcon(i); return r;
mode_ = new BuLabel(); mode_.setFont(CtuluLibSwing.getMiniFont()); mode_.setPreferredSize(new Dimension(150, 20)); mode_.setSize(new Dimension(150, 20)); mode_.setVisible(false); mode_.setOpaque(false); info_ = new BuLabel(); info_.setFont(mode_.getFont()); info_.setPreferredSize(new Dimension(120, 20)); info_.setSize(new Dimension(120, 20)); info_.setOpaque(false); info_.setVisible(true);
public void run() { message_.setText(s); //BuUpdateGUI.repaintNow(message_); } });
BuLabel l1 = new BuLabel(); BuLabel l2 = new BuLabel(); BuLabel l3 = new BuLabel(); BuLabelMultiLine l4 = new BuLabelMultiLine(); l1.setText(info_.name + " " + info_.version); l2.setText(info_.date); l3.setText(info_.authors[0]); l4.setText(info_.contact + "\n" + info_.http); l1.setHorizontalAlignment(SwingConstants.CENTER); l2.setHorizontalAlignment(SwingConstants.CENTER); l3.setHorizontalAlignment(SwingConstants.RIGHT); l4.setHorizontalAlignment(SwingConstants.RIGHT); l1.setFont(BuLib.deriveFont("Label", Font.BOLD, +6)); l2.setFont(BuLib.deriveFont("Label", Font.BOLD, +2)); l3.setFont(BuLib.deriveFont("Label", Font.PLAIN, 0)); l4.setFont(BuLib.deriveFont("Label", Font.PLAIN, -2)); load_ = new BuLabel(); load_.setText("Chargement..."); load_.setHorizontalAlignment(SwingConstants.LEFT); load_.setFont(BuLib.deriveFont("Label", Font.BOLD, -2));
/** * initialise tous les labels qui serviront de Titre. Le texte est aligne a gauche et centre verticalement. * * @param _titre le texte du label. */ private static BuLabel initBuLabelTitre(final String _titre) { final BuLabel r = new BuLabel(EbliResource.EBLI.getString(_titre)); r.setHorizontalAlignment(SwingConstants.LEFT); r.setVerticalAlignment(SwingConstants.CENTER); return r; }
public ZCalqueFlecheLegend(final ZCalqueFleche _support) { super(); support_ = _support; String[] props = FlecheScaleData.getScaleProperties(); for (int i = 0; i < props.length; i++) { support_.addPropertyChangeListener(props[i], this); } lbInfo_ = new BuLabel(); lbInfo_.setHorizontalAlignment(SwingConstants.CENTER); lbInfo_.setHorizontalTextPosition(SwingConstants.CENTER); fleche_ = new FlecheComponent(); initLegendPalette(); pnSize_ = new BuPanel(); pnSize_.setLayout(new BuVerticalLayout(2, true, false)); lbfleche_=new JLabel(fleche_); pnSize_.add(lbfleche_); pnSize_.add(lbInfo_); pnSize_.setOpaque(false); pnSize_.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.GRAY .brighter()), BuBorders.EMPTY5555)); support_.paletteLegende_.addUserComponent(pnSize_); if (support_.scale_.scaleFont_ != null) { lbInfo_.setFont(support_.scale_.scaleFont_); } init(); }
pnGrapheEd.setBorder(new TitledBorder("Graphe")); createGrapheTitre(); pnGrapheEd.add(new BuLabel("Titre "), nGraphe++); pnGrapheEd.add(tfGrapheTitre_, nGraphe++); createSousTitre(); pnGrapheEd.add(new BuLabel("Sous-titre "), nGraphe++); pnGrapheEd.add(tfGrapheSousTitre_, nGraphe++); createCbLegende(); pnGrapheEd.add(new BuLabel("Lgende "), nGraphe++); pnGrapheEd.add(cbGrapheLegende_, nGraphe++); createBtChanger(); pnGrapheEd.add(new BuLabel("Fond "), nGraphe++); pnGrapheEd.add(btGrapheFond_, nGraphe++); final BuPanel pnMargesGD= new BuPanel(); pnMargesGD.setLayout(new FlowLayout(FlowLayout.LEFT)); createMargeDr(); final BuLabel lbMargeD= new BuLabel("droite:"); pnMargesGD.add(lbMargeD); pnMargesGD.add(tfGrapheMargeD_); createMargeG(); final BuLabel lbMargeG= new BuLabel("gauche:"); pnMargesGD.add(lbMargeG); pnMargesGD.add(tfGrapheMargeG_); pnGrapheEd.add(new BuLabel("Marges "), nGraphe++); pnGrapheEd.add(pnMargesGD, nGraphe++); final BuPanel pnMargesHB= new BuPanel(); pnMargesHB.setLayout(new FlowLayout(FlowLayout.LEFT)); createMargeH(); final BuLabel lbMargeH= new BuLabel("haut:");
public final void valideExpr() { expr_.getParser().parseExpression(getExprText()); isValid_ = !expr_.getParser().hasError(); if (isValid_) { txtError_.setForeground(Color.BLACK); txtError_.setText(CtuluLib.getS("Valide")); txtError_.setToolTipText(txtError_.getText()); } else { txtError_.setForeground(Color.RED); txtError_.setText(expr_.getParser().getError(0) + (expr_.getParser().getNbError() > 0 ? "..." : CtuluLibString.EMPTY_STRING)); txtError_.setToolTipText(expr_.getParser().getHtmlError()); } btValid_.setEnabled(false); if (btEvaluate_ != null) { btEvaluate_.setEnabled(isValid_); } Variable[] newVar = null; if (isValid_) { newVar = expr_.findUsedVar(); Arrays.sort(newVar, new VariableComparator()); } if (newVar != varToSet_ && !Arrays.equals(varToSet_, newVar)) { varToSet_ = newVar; tModel_.fireChanged(); } expr_.findUsedVar(); }
final BuLabel lb = new BuLabel(si.getTitle()); lb.setToolTipText(si.getTooltip());