001package org.vishia.gral.ifc; 002 003import org.vishia.gral.base.GralWidget; 004 005/**Interface for all widgets which can represent a float value maybe showing or regarding a minimal and maximal value. 006 * It is applicable commonly. 007 * @author Hartmut Schorrig 008 * 009 */ 010public interface GralSetValue_ifc 011{ 012 013 014 /**Version, history and license. 015 * <ul> 016 * <li>2012-04-25 Hartmut new: {@link #setText(CharSequence)} 017 * <li>2012-04-01 Hartmut new: {@link #setValue(Object[])} as a possibility to set the appearance of a widget 018 * with more as one value, maybe float, integer etc. It is used for {@link org.vishia.gral.base.GralLed} 019 * to determine colors for border and inner. 020 * <li>2012-02-22 Hartmut enhanced: now used for lines of a curve view. Now basic interface for GralWidget. 021 * <li>2012-01-01 Hartmut Created, firstly only for the value bar. 022 * </ul> 023 * 024 * <b>Copyright/Copyleft</b>:<br> 025 * For this source the LGPL Lesser General Public License, 026 * published by the Free Software Foundation is valid. 027 * It means: 028 * <ol> 029 * <li> You can use this source without any restriction for any desired purpose. 030 * <li> You can redistribute copies of this source to everybody. 031 * <li> Every user of this source, also the user of redistribute copies 032 * with or without payment, must accept this license for further using. 033 * <li> But the LPGL is not appropriate for a whole software product, 034 * if this source is only a part of them. It means, the user 035 * must publish this part of source, 036 * but doesn't need to publish the whole source of the own product. 037 * <li> You can study and modify (improve) this source 038 * for own using or for redistribution, but you have to license the 039 * modified sources likewise under this LGPL Lesser General Public License. 040 * You mustn't delete this Copyright/Copyleft inscription in this source file. 041 * </ol> 042 * If you intent to use this source without publishing its usage, you can get 043 * a second license subscribing a special contract with the author. 044 * 045 * @author Hartmut Schorrig = hartmut.schorrig@vishia.de 046 */ 047 public static final int version = 20120425; 048 049 050 /**Sets a application specific info. 051 * It should help to present user data which are associated to this widget. 052 * This info can be set and changed anytime. */ 053 public void setContentInfo(Object content); 054 055 /**Gets the application specific info. See {@link #setContentInfo(Object)}. */ 056 public Object getContentInfo(); 057 058 /**Sets the data path. It is a String in application context. 059 * @param sDataPath 060 */ 061 public void setDataPath(String sDataPath); 062 063 /**Changes the data path 064 * @param sDataPath the new one 065 * @return the last one. 066 */ 067 public String getDataPath(); 068 069 public int getDataIx(); 070 071 public void setDataIx(int dataIx); 072 073 074 075 076 /**Sets a value to show. 077 * @param value 078 */ 079 void setValue(float value); 080 081 /**Sets a value to show. 082 * @param value 083 */ 084 void setLongValue(long value); 085 086 /**Sets some values to show any content. Depending from the type of widget more as one value 087 * can be used for several functionality. 088 * @param value array of floats 089 */ 090 void setValue(Object[] value); 091 092 /**See {@link GralWidget#setText(CharSequence)}. 093 * @param text 094 */ 095 void setText(CharSequence text); 096 097 098 /**Sets the border of the value range for showing. 099 * If it is a ValueBar, for example, it is the value for 0% and 100% 100 * @param minValue 101 * @param maxValue 102 */ 103 void setMinMax(float minValue, float maxValue); 104}