Package org.mj.eclipse.reporting.classpath.mvc.views

Examples of org.mj.eclipse.reporting.classpath.mvc.views.ProjectFigure


  protected IFigure createFigure() {
    if (logger.isLoggable(Level.FINE)) {
      //$ANALYSIS-IGNORE
      logger.fine("Creating figure");
    }
    return new ProjectFigure();
  }
View Full Code Here


      //$ANALYSIS-IGNORE
      logger.fine("Refreshing visulals");
    }
    super.refreshVisuals();

    ProjectFigure figure = (ProjectFigure) getFigure();
    INode model = (INode) getModel();
    figure.setName(model.getName());
   
    // TODO Remove the cast hack !  Never access internal model
    figure.setTitleColor(((ProjectModel)model).getColor());
   
    refreshLayout();
  }
View Full Code Here

  /**
   * @param figure
   */
  public void refreshLayout() {
    ProjectFigure figure = (ProjectFigure) getFigure();
    // Computes constraints
    Rectangle constraint = null;
    Rectangle bounds = figure.getBounds();
    if (bounds.height == 0 || bounds.width == 0) {
      // By setting the width and height to -1, we ensure that the preferred width and height are calculated automatically.
      constraint = new Rectangle(bounds.x, bounds.y, -1, -1);
    } else {
      constraint = new Rectangle(bounds);
View Full Code Here

  /**
   * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
   */
  public void propertyChange(PropertyChangeEvent evt) {
    // Handles model change
    ProjectFigure projectFigure = (ProjectFigure) getFigure();

    if (INode.Properties.LOCATION.represents(evt)) {
      projectFigure.setLocation((Point) evt.getNewValue());
      refreshLayout();
    } else if (INode.Properties.SIZE.represents(evt)) {
      projectFigure.setSize((Dimension) evt.getNewValue());
      refreshLayout();
    } else if (INode.Properties.X.represents(evt)) {
      projectFigure.setLocation(new Point((Double) evt.getNewValue(), projectFigure.getLocation().y));
      refreshLayout();
    } else if (INode.Properties.Y.represents(evt)) {
      projectFigure.setLocation(new Point(projectFigure.getLocation().x, (Double) evt.getNewValue()));
      refreshLayout();
    } else if (INode.Properties.WIDTH.represents(evt)) {
      projectFigure.setSize(((Double) evt.getNewValue()).intValue(), projectFigure.getSize().width);
      refreshLayout();
    } else if (INode.Properties.HEIGHT.represents(evt)) {
      projectFigure.setSize(projectFigure.getSize().width, ((Double) evt.getNewValue()).intValue());
      refreshLayout();
    } else if (INode.Properties.COLOR.represents(evt)) {
      projectFigure.setTitleColor((Color) evt.getNewValue());
    }
  }
View Full Code Here

TOP

Related Classes of org.mj.eclipse.reporting.classpath.mvc.views.ProjectFigure

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.