Package ca.nengo.ui.lib.world

Examples of ca.nengo.ui.lib.world.WorldLayer


  private Path line;

  public Anchor(ElasticObject obj) {
    super();
    this.obj = obj;
    WorldLayer ground = obj.getWorldLayer();

    border = Path.createRectangle(0, 0, 1, 1);
    line = new Path();
    // line.setStrokePaint(Style.COLOR)
    border.setPaint(null);
    line.setPaint(null);

    border.setStroke(new BasicStroke(2f));
    line.setStroke(new BasicStroke(2f));
    border.setStrokePaint(NengoStyle.COLOR_ANCHOR);
    line.setStrokePaint(NengoStyle.COLOR_ANCHOR);

    ground.addChild(line);
    ground.addChild(border);
    updateBounds();
    obj.addPropertyChangeListener(Property.REMOVED_FROM_WORLD, this);
    obj.addPropertyChangeListener(Property.GLOBAL_BOUNDS, this);
  }
View Full Code Here


     * (non-Javadoc)
     *
     * @see ca.shu.ui.lib.world.impl.IWorldObject#objectToGround(java.awt.geom.Point2D)
     */
    public Point2D objectToGround(Point2D position) {
        WorldLayer layer = getWorldLayer();

        myPNode.localToGlobal(position);

        if (layer instanceof WorldSkyImpl) {
            layer.getWorld().getSky().localToView(position);
            return position;
        } else if (layer instanceof WorldGroundImpl) {
            return position;
        }
        return null;
View Full Code Here

     * (non-Javadoc)
     *
     * @see ca.shu.ui.lib.world.impl.IWorldObject#objectToGround(java.awt.geom.Rectangle2D)
     */
    public Rectangle2D objectToGround(Rectangle2D rectangle) {
        WorldLayer layer = getWorldLayer();

        myPNode.localToGlobal(rectangle);

        if (layer instanceof WorldSkyImpl) {
            layer.getWorld().getSky().localToView(rectangle);
            return rectangle;
        } else if (layer instanceof WorldGroundImpl) {
            return rectangle;
        }
        return null;
View Full Code Here

     * (non-Javadoc)
     *
     * @see ca.shu.ui.lib.world.impl.IWorldObject#objectToSky(java.awt.geom.Point2D)
     */
    public Point2D objectToSky(Point2D position) {
        WorldLayer layer = getWorldLayer();

        myPNode.localToGlobal(position);

        if (layer instanceof WorldGroundImpl) {
            layer.getWorld().getSky().viewToLocal(position);
            return position;
        } else if (layer instanceof WorldSkyImpl) {
            return position;
        } else {
            throw new InvalidParameterException();
View Full Code Here

     * (non-Javadoc)
     *
     * @see ca.shu.ui.lib.world.impl.IWorldObject#objectToSky(java.awt.geom.Rectangle2D)
     */
    public Rectangle2D objectToSky(Rectangle2D rectangle) {
        WorldLayer layer = getWorldLayer();

        myPNode.localToGlobal(rectangle);

        if (layer != null) {
            if (layer instanceof WorldGroundImpl) {
                layer.getWorld().getSky().viewToLocal(rectangle);

            } else if (layer instanceof WorldSkyImpl) {

            } else {
                throw new InvalidParameterException();
View Full Code Here

TOP

Related Classes of ca.nengo.ui.lib.world.WorldLayer

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.