    001package org.vishia.gral.ifc;
    002
    003import org.vishia.gral.base.GralCurveView;
    004
    005/**This interface describes a track (one curve) of a curve view.
    006 * @see org.vishia.gral.widget.GralCurveView,
    007 * @see GralCurveView_ifc
    008 * @author Hartmut Schorrig
    009 *
    010 */
    011public interface GralCurveViewTrack_ifc extends GralSetValue_ifc
    012{
    013  /**Version, history and license.
    014   * <ul>
    015   * <li>2013-05-14 Hartmut new: {@link #getValueCursorLeft()}
    016   * <li>2013-05-14 Hartmut new: {@link #getIxTrack()}
    017   * <li>2012-06-08 Hartmut new: {@link #getDataPath()}, used to write settings.
    018   * <li>2012-06-08 Hartmut chg: {@link #setLineProperties(GralColor, int)} instead setLineColor()
    019   * <li>2012-04-01 Hartmut new: {@link #setDataPath(String)}
    020   * <li>2012-03-17 Hartmut created as interface to {@link org.vishia.gral.base.GralCurveView.Track}.
    021   *   Approach: Accessibility. The class Track is protected. Its details should only be used
    022   *   for implementation and inside {@link org.vishia.gral.base.GralCurveView}
    023   * </ul>
    024   * <br><br>
    025   * <b>Copyright/Copyleft</b>:
    026   * For this source the LGPL Lesser General Public License,
    027   * published by the Free Software Foundation is valid.
    028   * It means:
    029   * <ol>
    030   * <li> You can use this source without any restriction for any desired purpose.
    031   * <li> You can redistribute copies of this source to everybody.
    032   * <li> Every user of this source, also the user of redistribute copies
    033   *    with or without payment, must accept this license for further using.
    034   * <li> But the LPGL is not appropriate for a whole software product,
    035   *    if this source is only a part of them. It means, the user
    036   *    must publish this part of source,
    037   *    but doesn't need to publish the whole source of the own product.
    038   * <li> You can study and modify (improve) this source
    039   *    for own using or for redistribution, but you have to license the
    040   *    modified sources likewise under this LGPL Lesser General Public License.
    041   *    You mustn't delete this Copyright/Copyleft inscription in this source file.
    042   * </ol>
    043   * If you intent to use this source without publishing its usage, you can get
    044   * a second license subscribing a special contract with the author.
    045   *
    046   * @author Hartmut Schorrig = hartmut.schorrig@vishia.de
    047   *
    048   */
    049  public static final int version = 20120325;
    050
    051  /**Returns the scaling per division. One division is 1/10 of full y presentation, like usual
    052   *   on oscilloscopes.
    053   */
    054  float getScale7div();
    055
    056  /**Returns the value which is shown at the 0-line. */
    057  float getOffset();
    058
    059  /**Returns the position of the 0-line as value from 0 to 100 for this track. */
    060  int getLinePercent();
    061
    062  /**Returns the set color for this line. */
    063  GralColor getLineColor();
    064
    065  String getDataPath();
    066
    067  /**Change the scaling of a track.
    068   * @param trackNr Number of the track in order of creation, 0 ist the first.
    069   * @param scale7div value per division
    070   * @param offset value, which is shown at line0
    071   * @param line0 percent of 0-line in graphic.
    072   */
    073  void setTrackScale(float scale7div, float offset, int line0);
    074
    075  /**Refers the same instance {@link GralCurveView.TrackScale} with the other track.
    076   * All {@link #setTrackScale(float, float, int)} with tracks which are shared influences one another.
    077   * @param from one of the track of a scale group.
    078   */
    079  void groupTrackScale(GralCurveViewTrack_ifc from);
    080
    081  /**Checks whether the scaling is shared with the other given thread
    082   * @param with The other track.
    083   * @return true if it refers the same instance of scaling values.
    084   */
    085  boolean isGroupedTrackScale(GralCurveViewTrack_ifc with);
    086
    087  /**Creates an own instance for the scaling values. */
    088  void ungroupTrackScale();
    089
    090
    091  /**Sets the properties for this track.
    092   * @param color The color of line, null: no change
    093   * @param width The thickness of the line. 0: no change
    094   * @param pattern a Pattern of the line. Yet the pattern is not used (TODO). Value 0 doesn't change the current one.
    095   */
    096  void setLineProperties(GralColor color, int width, int pattern);
    097
    098  /**Set the state to show. 0=hidden, don't show, but the values are stored.
    099   * 1= show normal. 2= show lifted out (selected).
    100   */
    101  void setVisible(int mode);
    102
    103  /**Returns the state to show. 0=hidden, don't show, but the values are stored.
    104   * 1= show normal. 2= show lifted out (selected).
    105   */
    106  int getVisible();
    107
    108  void setDataPath(String path);
    109
    110  float getValueCursorLeft();
    111  float getValueCursorRight();
    112  float getValueLast();
    113  float getValueMin();
    114  float getValueMax();
    115
    116
    117}