Package DisplayProject.controls

Examples of DisplayProject.controls.PictureGraphic


      // Don't border menu lists.  CraigM 22/10/2007
      if (this._component instanceof MenuList) {
        return;
      }
      if (target instanceof PictureGraphic){
        PictureGraphic pg = (PictureGraphic)target;
            pg.setNegative(true);
      }
      target.putClientProperty(OLD_OPAQUE, new Boolean(target.isOpaque()));
      target.putClientProperty(OLD_BACKGROUND, target.getBackground());
      target.putClientProperty(OLD_FOREGROUND, target.getForeground());
      target.setOpaque(true);
View Full Code Here


      }
    }
   
    private static void resetSelectedComponent(JComponent target, HashSet<JComponent> selectedKids, Iterator<JComponent> it){
      if (target instanceof PictureGraphic){
        PictureGraphic pg = (PictureGraphic)target;
            pg.setNegative(false);
      }

      Boolean oldOpaque = (Boolean)target.getClientProperty(OLD_OPAQUE);
      Color OldBackground = (Color)target.getClientProperty(OLD_BACKGROUND);
      Color OldForeground = (Color)target.getClientProperty(OLD_FOREGROUND);
View Full Code Here

      // Don't border menu lists.  CraigM 22/10/2007
      if (this._component instanceof MenuList) {
        return;
      }
      if (target instanceof PictureGraphic){
        PictureGraphic pg = (PictureGraphic)target;
            pg.setNegative(true);
      }
      target.putClientProperty(OLD_OPAQUE, new Boolean(target.isOpaque()));
      target.putClientProperty(OLD_BACKGROUND, target.getBackground());
      target.putClientProperty(OLD_FOREGROUND, target.getForeground());
      target.setOpaque(true);
View Full Code Here

      }
    }
   
    private static void resetSelectedComponent(JComponent target, HashSet<JComponent> selectedKids, Iterator<JComponent> it){
      if (target instanceof PictureGraphic){
        PictureGraphic pg = (PictureGraphic)target;
            pg.setNegative(false);
      }

      Boolean oldOpaque = (Boolean)target.getClientProperty(OLD_OPAQUE);
      Color OldBackground = (Color)target.getClientProperty(OLD_BACKGROUND);
      Color OldForeground = (Color)target.getClientProperty(OLD_FOREGROUND);
View Full Code Here

            ImageData imageValue, int width, int height, int startX,
            int startY, int penColor, int fillColor, int frameColor,
            int frameWeight, int imageGravity, int scalingPolicy,
            int imageSizePolicy) {
        setForm(form);
        PictureGraphic pg = GraphicFactory.newPictureGraphic(null, imageValue);
        pg.setImageGravity(imageGravity);
        pg.setImageSizePolicy(imageSizePolicy);
        pg.setVisible(true);
        ColourChange.setForeground(pg, penColor);
        ColourChange.setBackground(pg, fillColor);
        FrameWeight.set(pg, frameWeight);
        FrameColor.set(pg, frameColor);
        java.awt.Point loc = location(startX, startY);
View Full Code Here

    }
    public static PictureGraphic newPictureGraphic(String name){ //PM:5/11/07
        return newPictureGraphic(name, Constants.CG_DEFAULT);
    }
    public static PictureGraphic newPictureGraphic(String name, int imageGravity){
        PictureGraphic jl = new PictureGraphic();
        jl.setBackground(null);
        jl.setName(name);
        jl.setFocusable(false);
        switch (imageGravity) {
            case Constants.CG_TOPLEFT:
                jl.setHorizontalAlignment(SwingConstants.LEFT);
                jl.setVerticalAlignment(SwingConstants.TOP);

            case Constants.CG_TOPCENTER:
                jl.setHorizontalAlignment(SwingConstants.CENTER);
                jl.setVerticalAlignment(SwingConstants.TOP);

            case Constants.CG_TOPRIGHT:
                jl.setHorizontalAlignment(SwingConstants.RIGHT);
                jl.setVerticalAlignment(SwingConstants.TOP);

            case Constants.CG_MIDDLELEFT:
                jl.setHorizontalAlignment(SwingConstants.LEFT);
                jl.setVerticalAlignment(SwingConstants.CENTER);

            case Constants.CG_MIDDLERIGHT:
                jl.setHorizontalAlignment(SwingConstants.RIGHT);
                jl.setVerticalAlignment(SwingConstants.CENTER);

            case Constants.CG_BOTTOMLEFT:
                jl.setHorizontalAlignment(SwingConstants.LEFT);
                jl.setVerticalAlignment(SwingConstants.BOTTOM);

            case Constants.CG_BOTTOMCENTER:
                jl.setHorizontalAlignment(SwingConstants.CENTER);
                jl.setVerticalAlignment(SwingConstants.BOTTOM);

            case Constants.CG_BOTTOMRIGHT:
                jl.setHorizontalAlignment(SwingConstants.RIGHT);
                jl.setVerticalAlignment(SwingConstants.BOTTOM);

            default:
                jl.setHorizontalAlignment(SwingConstants.CENTER);
                jl.setVerticalAlignment(SwingConstants.CENTER);

        }
        return jl;
    }
View Full Code Here

        }
        return jl;
    }
    public static PictureGraphic newPictureGraphic(String name, ImageIcon icon, int imageGravity){
        PictureGraphic jl = newPictureGraphic(name, imageGravity);
        jl.setIcon(icon);
        return jl;
    }
View Full Code Here

        PictureGraphic jl = newPictureGraphic(name, imageGravity);
        jl.setIcon(icon);
        return jl;
    }
    public static PictureGraphic newPictureGraphic(String name, URL resource, int imageGravity){
        PictureGraphic label = null;
        if (resource != null) {
            try {
                BufferedImage image = ImageIO.read(resource);
                if (image != null) {
                    ImageIcon icon = new ImageIcon(image);
                    label = newPictureGraphic(name, icon, imageGravity);
                }
                else
                    label = newPictureGraphic(name, Constants.CG_TOPLEFT);
                    label.setText("<" + resource + ">");
            } catch (IOException e) {
                label = newPictureGraphic(name, Constants.CG_TOPLEFT);
                label.setText("<" + resource + ">");
            }
        }
        else{
            label = newPictureGraphic(name, Constants.CG_TOPLEFT);
            label.setText("< unknown resource >");
        }
        return label;
    }
View Full Code Here

TOP

Related Classes of DisplayProject.controls.PictureGraphic

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.