Package org.jdesktop.swingx.painter

Examples of org.jdesktop.swingx.painter.Painter


     *
     * @param p the new painter
     * @see #getBackgroundPainter()
     */
    public void setBackgroundPainter(Painter p) {
        Painter old = getBackgroundPainter();
        backgroundPainter = p;
        firePropertyChange("backgroundPainter", old, getBackgroundPainter());
        repaint();
    }
View Full Code Here


   *
   * @param textComponent
   * @return the background painter of the text component
   */
  public static Painter getBackgroundPainter(JTextComponent textComponent) {
      Painter painter = (Painter) textComponent.getClientProperty(BACKGROUND_PAINTER);
     
      if (painter == null) {
          painter = Painters.EMPTY_PAINTER;
      }
     
View Full Code Here

     *
     * @param p the new painter
     * @see #getBackgroundPainter()
     */
    public void setBackgroundPainter(Painter p) {
        Painter old = getBackgroundPainter();
        if (old instanceof AbstractPainter) {
            ((AbstractPainter) old).removePropertyChangeListener(painterChangeListener);
        }
        backgroundPainter = p;
        if (backgroundPainter instanceof AbstractPainter) {
View Full Code Here

   
    private boolean loaded = false;
   
    private void load() {
        try {
            Painter painter = PainterUtil.loadPainter(url);
            this.setPainters(painter);
            loaded = true;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

    @Override
    public void updateUI() {
        if ("Nimbus".equals(UIManager.getLookAndFeel().getName())) {
            UIDefaults map = new UIDefaults();
            Painter painter = new Painter() {

                Color color = null;

                @Override
                public void paint(Graphics2D g, Object c, int w, int h) {
View Full Code Here

      catch ( Exception e )
      {}
    }
    else if ( attribNameLwr.equals( "painter" )) {
      try {
        Painter xp = (Painter)Class.forName( attribValueStr.trim()).newInstance();
        setPainter( xp );
      }
      catch ( Exception e )
      {}
    }
View Full Code Here

        antiAlias = attribValue.equals( "true" );
      else if ( attribNameLwr.equals( "userenderer" ))
        textRenderer = new XTextRenderer();
      else if ( attribNameLwr.equals( "painter" )) {
        try {
          Painter xp = (Painter)Class.forName( attribValueStr.trim()).newInstance();
          setPainter( xp );
        }
        catch ( Exception e )
        {}
      }
View Full Code Here

      setStretchMode( Math.max( 0, new Integer( attribValueStr ).intValue()));
    else if ( attribNameLwr.equals( "center" ))
      setCenterImage( attribValueLwr.equals( "true" ));
    else if ( attribNameLwr.equals( "painter" )) {
      try {
        Painter xp = (Painter)Class.forName( attribValueStr.trim()).newInstance();
        setPainter( xp );
      }
      catch ( Exception e )
      {}
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.painter.Painter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.