protected static Font getETF() { return BuLib.deriveFont("List",Font.PLAIN,-2); }
public void setError(final URL _url, final String _text) { if (Fu.DEBUG && FuLog.isDebug()) { FuLog.debug("WBP: setError " + _url + " " + _text); } final Runnable runnable = new Runnable() { public void run() { if (_url != null) { frame_.setUrlText(_url.toExternalForm(), false); } frame_.setTitle(BuResource.BU.getString("Erreur")); // BuResource.BU.getString("Erreur")); html_.setCursor(cursor_); String t = _text; if (_url != null && "http".equals(_url.getProtocol())) { t += "<BR>" + CtuluLib.getS("Il se peut que vos paramtres de connexion ne soient pas jour") + "<BR> <a href=\"ShowProxy\">" + CtuluLib.getS("Vrifier vos paramtres de connexion") + "</a>"; } if (t == null) { t = "<BR>" + CtuluLib.getS("Cette adresse ne peut pas tre affiche"); t += (_url != null) ? ":<BR> " + _url.toExternalForm() : CtuluLibString.DOT; } setContent(_url, "<HTML><BODY>" + t + "</BODY></HTML>", BuResource.BU.getString("Erreur"), true); // TMP //html_.setText("<HTML><BODY>"+t+"</BODY></HTML>"); } }; BuLib.invokeLater(runnable); }
/** * Returns all subcomponents of a container. */ public static Vector getAllSubComponents(Container _parent) { Vector r = new Vector(); getAllSubComponents(r, _parent); return r; }
/** * Find a named component. */ public static Component findNamedComponent(Container _parent, String _name) { Component r = null; Enumeration e = getAllSubComponents(_parent).elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); String n = c.getName(); if (_name.equals(n) || _name.equals(simplifyComponentName(n))) { r = c; break; } } return r; }
public Dimension getPreferredSize() { Font ft=BuLib.deriveFont("MenuItem",Font.BOLD,-2); FontMetrics fm=BuLib.getFontMetrics(this,ft); Dimension r=super.getPreferredSize(); if(text_!=null) { r.width =Math.max(r.width ,6+fm.stringWidth(text_)); r.height=Math.max(r.height,6+fm.getAscent()+fm.getDescent()); } return r; } }
/** * Set scollmode for all the viewports in a tree of components. */ public static void setScrollMode(Container _parent, int _mode) { int mode = _mode; if ((_parent != null)/* &&(FuLib.jdk()>=1.3) */) { if ((mode != JViewport.SIMPLE_SCROLL_MODE) && getUIBoolean("Viewport.simpleMode")) mode = JViewport.SIMPLE_SCROLL_MODE; Enumeration e = getAllSubComponents(_parent).elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c instanceof JPopupMenu) continue; if (c instanceof Window) continue; if (c instanceof JViewport) ((JViewport) c).setScrollMode(mode); } } }
if((bar==null)||(Boolean.TRUE.equals(bar))) if(!BuLib.isSlaf()&& !BuLib.isMetal()&& !BuLib.isLiquid()&& !BuLib.isSynthetica()) if(ft==null) ft=BuLib.deriveFont("MenuItem",Font.BOLD,-2); int hs=ft.getSize()+2;
BuLib.invokeNow(runnable); BuLib.invokeLater(runnable);
container_.setBorder(BuLib.getEmptyBorder(GAP));// BuBorders.EMPTY0000); container_.add(urlBar_, BuBorderLayout.NORTH); container_.add(pane_, BuBorderLayout.CENTER); sbStatus_.setFont(BuLib.deriveFont("Label", Font.PLAIN, -2));
setBackground(BuLib.getColor(Color.white)); p.setBackground(BuLib.getColor(Color.white)); p.setBorder(EMPTY0505); add(p,BorderLayout.CENTER); title_.setFont(BuLib.deriveFont(title_.getFont(),Font.PLAIN,+6)); title_.setForeground(BuLib.getColor(Color.gray)); title_.setPreferredWidth(305); title_.setWrapMode(BuLabelMultiLine.WORD); title_.setFont(BuLib.deriveFont(title_.getFont(),Font.PLAIN,+0)); text_.setForeground(BuLib.getColor(Color.black)); text_.setPreferredWidth(305); text_.setWrapMode(BuLabelMultiLine.WORD);
mpi.setBorder(BuLib.getEmptyBorder(GAP)); //10,10,10,10)); Color bg=BuLib.getColor(mpi.getBackground().darker()); Color fg=BuLib.getColor(Color.white); if(bg.equals(fg)) fg=BuLib.getColor(Color.black); mpi.setBackground(bg); mpi.setForeground(fg); ml_isoft.setFont(BuLib.deriveFont("Label",Font.PLAIN,-2)); layout_.setVgap(GAP); content_=new BuPanel(); content_.setBorder(BuLib.getEmptyBorder(GAP));//BuBorders.EMPTY5555); content_.setLayout(layout_); mct.add(content_,BuBorderLayout.CENTER);
public JComponent getComponent() { lbExplanation_=new BuLabelMultiLine(); lbTrace_ =new BuLabelMultiLine(); tbProperties_ =new BuTable(); tbEnvironment_=new BuTable(); lbExplanation_.setOpaque(true); lbExplanation_.setBackground(BuLib.getColor(Color.white)); lbExplanation_.setForeground(BuLib.getColor(Color.black)); lbExplanation_.setWrapMode(BuLabelMultiLine.WORD); lbExplanation_.setBorder(BuBorders.EMPTY5555); lbExplanation_.setFont(BuLib.deriveFont("Label",Font.PLAIN,0)); lbTrace_.setOpaque(true); lbTrace_.setBackground(BuLib.getColor(Color.white)); lbTrace_.setForeground(BuLib.getColor(Color.black)); lbTrace_.setWrapMode(BuLabelMultiLine.NONE); lbTrace_.setBorder(BuBorders.EMPTY5555); BuLib.setMonospacedFont(lbTrace_); tbPane_=new BuTabbedPane(); tbPane_.addTab(_("Texte"),null, new BuScrollPane(lbExplanation_),null); tbPane_.addTab(_("Trace"),null, new BuScrollPane(lbTrace_),null); tbPane_.addTab(_("Proprits"),null, new BuScrollPane(tbProperties_),null); tbPane_.addTab(_("Environment"),null, new BuScrollPane(tbEnvironment_),null); return tbPane_; }
public void actionPerformed(final ActionEvent _e) { BuLib.invokeNow(new Runnable() { public void run() { startComputing(); } }); new Thread() { public void run() { if (PaletteRefreshPanel.this.plage_.dataBoite_ == null) { PaletteRefreshPanel.this.plage_.dataBoite_ = new CtuluRange(); } PaletteRefreshPanel.this.plage_.target_.getTimeRange(PaletteRefreshPanel.this.plage_.dataBoite_); if (PaletteRefreshPanel.this.plage_.dataBoite_.isNill()) { plage_.valueEditor_.setValue(null, newMax_); plage_.valueEditor_.setValue(null, newMin_); erreurNotFound(); } else { plage_.valueEditor_.setValue(Double.toString(PaletteRefreshPanel.this.plage_.dataBoite_.max_), newMax_); plage_.valueEditor_.setValue(Double.toString(PaletteRefreshPanel.this.plage_.dataBoite_.min_), newMin_); } final Runnable r = new Runnable() { public void run() { stopComputing(); } }; BuLib.invokeNow(r); } }.start(); } });
btInsert_.setActionCommand("AJOUTER"); btInsert_.setMargin(BuInsets.INSETS1111); btInsert_.setFont(BuLib.deriveFont("Button",Font.PLAIN,0)); btInsert_.addActionListener(this); q.add(btInsert_); btRemove_.setActionCommand("ENLEVER"); btRemove_.setMargin(BuInsets.INSETS1111); btRemove_.setFont(BuLib.deriveFont("Button",Font.PLAIN,0)); btRemove_.addActionListener(this); q.add(btRemove_); btUp_.setActionCommand("RECULER"); btUp_.setMargin(BuInsets.INSETS1111); btUp_.setFont(BuLib.deriveFont("Button",Font.PLAIN,0)); btUp_.addActionListener(this); q.add(btUp_); btDown_.setActionCommand("AVANCER"); btDown_.setMargin(BuInsets.INSETS1111); btDown_.setFont(BuLib.deriveFont("Button",Font.PLAIN,0)); btDown_.addActionListener(this); q.add(btDown_); BuLib.computeMnemonics(q); p.add(q,BuBorderLayout.SOUTH);
void draw(Graphics _g) { int[] x=new int[] { p_[0].x_, p_[1].x_, p_[2].x_ }; int[] y=new int[] { p_[0].y_, p_[1].y_, p_[2].y_ }; int r=(p_[0].r_+p_[1].r_+p_[2].r_)/3; int v=(p_[0].v_+p_[1].v_+p_[2].v_)/3; int b=(p_[0].b_+p_[1].b_+p_[2].b_)/3; BuLib.setColor(_g,new Color(r,v,b)); _g.fillPolygon(x,y,3); } }
BuLib.setAntialiasing(_g); BuLib.setColor(_g,Color.blue); _g.drawLine(_x+getIconWidth()-1,_y, _x,_y+getIconHeight()-1);
public static void computeMnemonics(Container _rootpane, ActionListener _al) { Vector v = BuLib.getAllSubComponents(_rootpane); Hashtable t = new Hashtable(); Hashtable u = new Hashtable(); Component tg = (Component) v.elementAt(i + 1); if (!tg.isFocusable() && (tg instanceof Container)) { Vector w = BuLib.getAllSubComponents((Container) tg); int lw = w.size(); tg = null; if (u.get(c) != null) {} else if (c instanceof AbstractButton) { AbstractButton ab = (AbstractButton) c; boolean auto = getAutoMnemonic(ab); int mn = ab.getMnemonic(); String tx = candidateMnemonics(ab.getText()); if (tx != null) for (int j = 0; j < tx.length(); j++) { mn = tx.charAt(j); boolean auto = getAutoMnemonic(lb); int mn = lb.getDisplayedMnemonic(); String tx = candidateMnemonics(lb.getText()); if (tx != null) for (int j = 0; j < tx.length(); j++) { mn = tx.charAt(j);
public synchronized void paintComponent(Graphics _g) BuLib.setAntialiasing(this,_g); BuLib.setColor(_g,getBackground()); _g.fillRect(0,0,getWidth(),getHeight()); lc=BuLib.mixColors(lc,0xFF000000); lc=BuLib.mixColors(lc,0xFFFFFFFF); lc=BuLib.mixColors(lc,getBackground().getRGB()); BuLib.setColor(_g,new Color(lc)); _g.drawLine(0,l_to_y(nbl_),c_to_x(nbc_),l_to_y(nbl_)); _g.drawLine(c_to_x(132),0,c_to_x(132),l_to_y(nbl_)); BuLib.setColor(_g,getForeground());
public static void computeMnemonics(Container _rootpane) { computeMnemonics(_rootpane, null); }