Package es.iiia.shapeeditor.controllers

Examples of es.iiia.shapeeditor.controllers.ControllerBase


        public void paint(java.awt.Graphics g) {
          RuleModel rule = (RuleModel) model;
          if (rule.getLeftShape() != null) {
            int iconSize = getWidth() < getHeight() ? getWidth() : getHeight();
           
            ControllerBase ctr = null;
            try {
              ctr = ControllerFactory.CreateController(rule);
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
            //ShapeModel sh = rule.getLeftShape().getShape();
            // now draw this control
            GeneralPath shape = (GeneralPath) ctr.getShape();
            Rectangle2D bounds = shape.getBounds();
            // get the resize ratio
            double resize = (iconSize - 9)
                / (bounds.getWidth() > bounds.getHeight() ? bounds
                    .getWidth() : bounds.getHeight()) ;
View Full Code Here


    getEditControllers().clear();
   
    try {
      // init left side shape
      if (rule.getLeftShape() != null) {
        ControllerBase ctrl = ControllerFactory.CreateController(rule.getLeftShape());
        ctrl.addPropertyChangeListener(this);
        getEditControllers().add(ctrl);
        ctrl.getModel().setColor(Color.red);
      }
     
      // init right side shape
      if (rule.getRightShape() != null) {
        ControllerBase ctrr = ControllerFactory.CreateController(rule.getRightShape());
        ctrr.addPropertyChangeListener(this);
        getEditControllers().add(ctrr);
      }
    } catch (Exception e1) {
      e1.printStackTrace();
    }   
View Full Code Here

      panel = new JPanel() {
        public void paint(java.awt.Graphics g) {         
          int iconSize = getWidth() < getHeight() ? getWidth()
              : getHeight();
 
          ControllerBase ctr = null;
          try {
            ctr = ControllerFactory.CreateController(model);
          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          // ShapeModel sh = rule.getLeftShape().getShape();
          // now draw this control
          GeneralPath shape = (GeneralPath) ctr.getShape();
          Rectangle2D bounds = shape.getBounds();
          // get the resize ratio
          double resize = (iconSize - 9)
              / (bounds.getWidth() > bounds.getHeight() ? bounds
                  .getWidth() : bounds.getHeight());
View Full Code Here

  protected void initModel() {
    editControllers.clear();
    for (NodeModel model : this.model.getChildrenArray()) {
      if (model instanceof GeometryModel) {
        try {
          ControllerBase ctr = ControllerFactory.CreateController((GeometryModel) model);
          ctr.addPropertyChangeListener(this);
          editControllers.add(ctr);
        } catch (Exception e1) {
          e1.printStackTrace();
        }
      }
View Full Code Here

    // select shapes
    getSelectedControllers().clear();
    this.selectionChanged();
   
    int minDistance = Integer.MAX_VALUE;
    ControllerBase ctr = null;
    for (int i = 0; i < getEditControllers().size(); i++) {
      if (getEditControllers().get(i).getDistance(startPoint) < minDistance) {
        minDistance = (int) getEditControllers().get(i).getDistance(startPoint);
        ctr =  getEditControllers().get(i);
        String uu;
View Full Code Here

TOP

Related Classes of es.iiia.shapeeditor.controllers.ControllerBase

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.