001package org.vishia.gral.ifc; 002 003/**This interface is used to free-draw on a canvas area. It is implemented by the 004 * {@link GralCanvasStorage} and by implementation classes. 005 * @author Hartmut Schorrig 006 * 007 */ 008public interface GralCanvas_ifc 009{ 010 011 012 /**Version and history: 013 * <ul> 014 * <li>2011-11-01 Created. It is necessary to build common use-able widgets on gral level, 015 * it may be usefully to draw and paint on user level. Therefore this universal interface is need. 016 * </ul> 017 /**Version, history and license. 018 * <ul> 019 * <li>2011-06-00 Hartmut created 020 * </ul> 021 * 022 * <b>Copyright/Copyleft</b>:<br> 023 * For this source the LGPL Lesser General Public License, 024 * published by the Free Software Foundation is valid. 025 * It means: 026 * <ol> 027 * <li> You can use this source without any restriction for any desired purpose. 028 * <li> You can redistribute copies of this source to everybody. 029 * <li> Every user of this source, also the user of redistribute copies 030 * with or without payment, must accept this license for further using. 031 * <li> But the LPGL is not appropriate for a whole software product, 032 * if this source is only a part of them. It means, the user 033 * must publish this part of source, 034 * but doesn't need to publish the whole source of the own product. 035 * <li> You can study and modify (improve) this source 036 * for own using or for redistribution, but you have to license the 037 * modified sources likewise under this LGPL Lesser General Public License. 038 * You mustn't delete this Copyright/Copyleft inscription in this source file. 039 * </ol> 040 * If you intent to use this source without publishing its usage, you can get 041 * a second license subscribing a special contract with the author. 042 * 043 * @author Hartmut Schorrig = hartmut.schorrig@vishia.de 044 */ 045 public static final int version = 20111101; 046 047 048 /**Accepts a order to draw a line. The coordinates are stored only. 049 * This method can be called in any thread. It is thread-safe. 050 * @param color 051 * @param x1 TODO yet it is pixel coordinates, use GralGrid coordinates. 052 * @param y1 053 * @param x2 054 * @param y2 055 */ 056 public void drawLine(GralColor color, int x1, int y1, int x2, int y2); 057 058 059 public void drawImage(GralImageBase image, int x, int y, int dx, int dy, GralRectangle imagePixelSize); 060 061 062 public void setTextStyle(GralColor color, GralFont font, int origin); 063 064 public void drawText(String text); 065 066 067}