terrainprofilelayer.java

来自「world wind java sdk 源码」· Java 代码 · 共 1,710 行 · 第 1/5 页

JAVA
1,710
字号
     */
    public Vec4 getLocationOffset()
    {
        return locationOffset;
    }

    /**
     * Specifies a placement offset from the layer position on the screen.
     *
     * @param locationOffset the number of pixels to shift the layer image from its specified screen position. A
     * positive X value shifts the image to the right. A positive Y value shifts the image up. If null, no offset
     * is applied. The default offset is null.
     * @see #setLocationCenter, #setPosition
     */
    public void setLocationOffset(Vec4 locationOffset)
    {
        this.locationOffset = locationOffset;
    }

    /**
     * Returns the layer's resize behavior.
     *
     * @return the layer's resize behavior.
     */
    public String getResizeBehavior()
    {
        return resizeBehavior;
    }

    /**
     * Sets the behavior the layer uses to size the graphic when the viewport size changes, typically when the World
     * Wind window is resized. If the value is {@link AVKey#RESIZE_KEEP_FIXED_SIZE}, the graphic size is kept to the
     * size specified in its Dimension scaled by the layer's current icon scale. If the value is
     * {@link AVKey#RESIZE_STRETCH}, the graphic is resized to have a constant size relative to the current viewport
     * size. If the viewport shrinks the graphic size decreases; if it expands then the graphic enlarges. If the value
     * is {@link AVKey#RESIZE_SHRINK_ONLY} (the default), graphic sizing behaves as for {@link AVKey#RESIZE_STRETCH}
     * but it will not grow larger than the size specified in its Dimension.
     *
     * @param resizeBehavior the desired resize behavior
     */
    public void setResizeBehavior(String resizeBehavior)
    {
        this.resizeBehavior = resizeBehavior;
    }

    public int getBorderWidth()
    {
        return borderWidth;
    }

    /**
     * Sets the graphic offset from the viewport border.
     *
     * @param borderWidth the number of pixels to offset the graphic from the borders indicated by {@link
     *                    #setPosition(String)}.
     */
    public void setBorderWidth(int borderWidth)
    {
        this.borderWidth = borderWidth;
    }

    public String getUnit()
    {
        return this.unit;
    }

    /**
     * Sets the unit the graphic uses to display distances and elevations. Can be one of {@link #UNIT_METRIC} (the
     * default), or {@link #UNIT_IMPERIAL}.
     *
     * @param unit the desired unit.
     */
    public void setUnit(String unit)
    {
        this.unit = unit;
    }

    /**
     * Get the graphic legend Font.
     *
     * @return the graphic legend Font.
     */
    public Font getFont()
    {
        return this.defaultFont;
    }

    /**
     * Set the graphic legend Font.
     *
     * @param font the graphic legend Font.
     */
    public void setFont(Font font)
    {
        if (font == null)
        {
            String msg = Logging.getMessage("nullValue.FontIsNull");
            Logging.logger().severe(msg);
            throw new IllegalArgumentException(msg);
        }
        this.defaultFont = font;
    }

    /**
     * Get whether distance/elevation proportions are maintained.
     *
     * @return true if the graph maintains distance/elevation proportions.
     */
    public boolean getKeepProportions()
    {
        return this.keepProportions;
    }

    /**
     * Set whether distance/elevation proportions are maintained.
     *
     * @param state true if the graph should maintains distance/elevation proportions.
     */
    public void setKeepProportions(boolean state)
    {
        this.keepProportions = state;
    }

    /**
     * Get whether the graph center point follows the mouse cursor.
     *
     * @return true if the graph center point follows the mouse cursor.
     */
    public boolean getFollowCursor()
    {
        return this.follow.equals(FOLLOW_CURSOR);
    }

    /**
     * Set whether the graph center point should follows the mouse cursor.
     *
     * @param state true if the graph center point should follows the mouse cursor.
     */
    public void setFollowCursor(boolean state)
    {
        this.setFollow(state ? FOLLOW_CURSOR : FOLLOW_VIEW);
    }

    /**
     * Get the graph center point placement behavior.
     *
     * @return the graph center point placement behavior.
     */
    public String getFollow()
    {
        return this.follow;
    }

    /**
     * Set the graph center point placement behavior. Can be one of {@link #FOLLOW_VIEW} (the default), {@link
     * #FOLLOW_CURSOR}, {@link #FOLLOW_EYE}, {@link #FOLLOW_OBJECT}, {@link #FOLLOW_NONE} or {@link #FOLLOW_PATH}.
     * If {@link #FOLLOW_NONE} the profile will be computed between startLatLon and endLatLon. If {@link #FOLLOW_PATH}
     * the profile will be computed along the path defined with {@link #setPathPositions(ArrayList<? extends LatLon>)}.
     *
     * @param behavior the graph center point placement behavior.
     */
    public void setFollow(String behavior)
    {
        this.follow = behavior;
        this.setUpdate(true);
    }

    /**
     * Get whether the eye or object position is shown on the graph when {@link #FOLLOW_EYE} or {@link #FOLLOW_OBJECT}.
     *
     * @return true if the eye or object position is shown on the graph.
     */
    public boolean getShowEyePosition()
    {
        return this.showEyePosition;
    }

    /**
     * Set whether the eye or object position should be shown on the graph when {@link #FOLLOW_EYE} or
     * {@link #FOLLOW_OBJECT}.
     *
     * @param state if true the eye or object position should be shown on the graph.
     */
    public void setShowEyePosition(Boolean state)
    {
        this.showEyePosition = state;
        if (this.follow.equals(FOLLOW_EYE))
            this.setUpdate(true);
    }

    /**
     * Set the profile length factor - has no effect if {@link #FOLLOW_NONE} or {@link #FOLLOW_PATH}
     *
     * @param factor the new profile length factor.
     */
    public void setProfileLengthFactor(double factor)
    {
        this.profileLengthFactor = factor;
        this.setUpdate(true);
    }

    /**
     * Get the profile length factor.
     *
     * @return the profile length factor.
     */
    public double getProfileLenghtFactor()
    {
        return this.profileLengthFactor;
    }

    /**
     * Get the profile start position lat/lon when {@link #FOLLOW_NONE}.
     *
     * @return the profile start position lat/lon.
     */
    public LatLon getStartLatLon()
    {
        return this.startLatLon;
    }

    /**
     * Set the profile start position lat/lon when {@link #FOLLOW_NONE}.
     *
     * @param latLon the profile start position lat/lon.
     */
    public void setStartLatLon(LatLon latLon)
    {
        if (latLon == null)
        {
            String msg = Logging.getMessage("nullValue.LatLonIsNull");
            Logging.logger().severe(msg);
            throw new IllegalArgumentException(msg);
        }
        this.startLatLon = latLon;
        if (this.follow.equals(FOLLOW_NONE))
            this.setUpdate(true);
    }

    /**
     * Get the profile end position lat/lon when {@link #FOLLOW_NONE}.
     *
     * @return the profile end position lat/lon.
     */
    public LatLon getEndLatLon()
    {
        return this.endLatLon;
    }

    /**
     * Set the profile end position lat/lon when {@link #FOLLOW_NONE}.
     *
     * @param latLon the profile end position lat/lon.
     */
    public void setEndLatLon(LatLon latLon)
    {
        if (latLon == null)
        {
            String msg = Logging.getMessage("nullValue.LatLonIsNull");
            Logging.logger().severe(msg);
            throw new IllegalArgumentException(msg);
        }
        this.endLatLon = latLon;
        if (this.follow.equals(FOLLOW_NONE))
            this.setUpdate(true);
    }

    /**
     * Get the number of elevation samples in the profile.
     *
     * @return the number of elevation samples in the profile.
     */
    public int getSamples()
    {
        return this.samples;
    }

    /**
     * Set the number of elevation samples in the profile.
     *
     * @param number the number of elevation samples in the profile.
     */
    public void setSamples(int number)
    {
        this.samples = Math.abs(number);
        this.setUpdate(true);
    }

    /**
     * Get whether the profile graph should include sea level.
     *
     * @return whether the profile graph should include sea level.
     */
    public boolean getZeroBased()
    {
        return this.zeroBased;
    }

    /**
     * Set whether the profile graph should include sea level. True is the default.
     *
     * @param state true if the profile graph should include sea level.
     */
    public void setZeroBased(boolean state)
    {
        this.zeroBased = state;
        this.setUpdate(true);
    }

    /**
     * Get the object position the graph follows when it is set to {@link #FOLLOW_OBJECT}.
     * @return the object position the graph follows.
     */
    public Position getObjectPosition()
    {
        return this.objectPosition;
    }

    /**
     * Set the object position the graph follows when it is set to {@link #FOLLOW_OBJECT}.
     * @param pos the object position the graph follows.
     */
    public void setObjectPosition(Position pos)
    {
        this.objectPosition = pos;
        if (this.follow.equals(FOLLOW_OBJECT))
            this.setUpdate(true);
    }

    /**
     * Get the object heading the graph follows when it is set to {@link #FOLLOW_OBJECT}. The profile graph will
     * be computed perpendicular to the object heading direction.
     * @return the object heading the graph follows.
     */
    public Angle getObjectHeading()
    {
        return this.objectHeading;
    }

    /**
     * Set the object heading the graph follows when it is set to {@link #FOLLOW_OBJECT}. The profile graph will
     * be computed perpendicular to the object heading direction.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?