Zu hoher Speicherverbrauch beim Zeichnen (Canvas)

Status
Nicht offen für weitere Antworten.

Nicole81

Aktives Mitglied
Hallöchen ihr!

Ich habe eine von Canvas abgeleitete Klasse mit der ich mehrere Kurven (Freihand und Bezier) und so kram zeichnen kann. Dafür sind einige Arrays notwendig (z.b. 3 dim 10000*4*4 usw).

Ich meiner Anwendung erzeuge ich 128 Objekte von dieser Klasse. Ich kann nun zwischen den Zeichenflächen wechseln und auf jedes entsprechend zeichnen (z.b. mit der drawFreehand(..) Methode). Nach dem 4-5. Objekt stockt das Programm allerdings und dann geht gar nichts mehr mit einer out of heap memory Exception. Wenn ich den VM Speicher nun erhöhe geht es etwas länger, das ist ja aber auch nicht die Lösung des Problems. Irgendwas in meiner Paint Methode muss wahnsinnig Speicher fressen, der nicht wieder freigegeben wird. Ich hole aber nirgens was mit "new" deshalb poste ich mal die Canvas Klasse (ich weiß, ist lang aber interssant wäre die Paint Methode), vielleicht hat jemand Lust über die Paint - Methode zu schauen und findet etwas.

Danke ihr lieben und Gruß

Code:
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Polygon;

public class S2M_GRID_Main extends Canvas
{
	private static final long serialVersionUID = 1L;
	
	// defines
	public static final int NUMBERCURVES = 4;
	public static final int CURVE1 = 0;
	public static final int CURVE2 = 1;
	public static final int CURVE3 = 2;
	public static final int CURVE4 = 3;
	public static final int NODE1 = 0;
	public static final int NODE2 = 1;
	public static final int NODE3 = 2;
	public static final int NODE4 = 3;
	private static final int X = 0;
	private static final int Y = 1;
	private static final int POINTTYPE = 2;
	public static final int PTAUTO = 0;
	public static final int PTMANU = 1;
	private static final int NOTSET = -1;
	private static final int NODECOLOR = 2;
	private static final int MINPOINTS = 3;
	private static final int CURVEITERATOR = 1;
	private static final int FROM = 0;
	private static final int TO = 1;
	private static final int ISKEYPOINT = 1;
	private static final int KEYTIME = 3;
	private static final int MAXDELAY = 10000;   // ms == 10sec
	private static final int MAXGRIDSIZE = 2000;   // pixel
	private static final int MINGRIDSIZE = 100;   // pixel
	private static final int CURVECOORDRESIZEVALUE = 2000;
	private static final int POINTSRESIZEVALUE = 20;
	private static final int FREECURVERESIZEVALUE = 200;
	private static final int NODESRESIZEVALUE = 10;
	private static final int NODECONNECTORSRESIZEVALUE = 10;
	
	// standard values
	private static final int NodeSizeMax = 100;
	private static final int GridSizeMax = 500;
	private static final int PointSizeMax = 50;
	private static final int KeyPointSizeMax = 50;
	private static final int LoopCountStandard = 0;
	private static final int KeyPointDistance = 20;
	
	// static variables
	private static final double CurveDivisor = 0.5d;
	private static int MaxPoints = 100;  // TODO umbenennen in start size
	private static int MaxNodes = 50;
	private static int MaxNodeConnectors = 50;
	private static int MaxFreeCurveCoords = 1000;
	private static int MaxCurveCoords = 10000;
	
	private static Color Node1Color = Color.BLACK;
	private static Color Node2Color = Color.YELLOW;
	private static Color Node3Color = Color.BLUE;
	private static Color Node4Color = Color.GREEN;
	private static Color NodeConnectorColor = Color.GRAY;
	private static String Node1Label = "Node1";
	private static String Node2Label = "Node2";
	private static String Node3Label = "Node3";
	private static String Node4Label = "Node4";
	private static int NodeSize = 12;
	private static Color BackgroundColor = Color.WHITE;
	private static Color GridColor = Color.CYAN;
	private static int GridSize = 30;
	private static int PointSize = 6;
	private static Color AutoPointColor = Color.RED;
	private static Color ManuPointColor = Color.ORANGE;
	private static Color LineColor = Color.BLACK;
	private static Color KeyPointColor = Color.PINK;
	private static int KeyPointSize = 16;
	
	private static int GridXmm = 20;  // 1 pixel in mm
	private static int GridYmm = 20;
	private static int CurveSamplingRate = 20;  // in ms
	private static int DelayCompensation = 0;  // in ms
	private static int GridSizeX = 1000;
	private static int GridSizeY = 1000;
	
	// object variables
	private int[] PointCounter;
	private int[][][] Points;
	private int[][] CopyPoints;
	private int[] FreeCurveCoordCounter;
	private int[][][] FreeCurveCoords;
	private int NodeCounter;
	private int[][] Nodes;
	private int NodeConnectorCounter;
	private int[][] NodeConnectors;
	private int[] CurveCoordCounter;
	private int[][][] CurveCoords;
	private int[] KeyPointCounter;
	private int[][] OutputData;
	private int[][] StaticOutput;
	private int[][] Curve1Output;
	private int[][] Curve2Output;
	private int[][] Curve3Output;
	private int[][] Curve4Output;
	
	private boolean calcIntermPix;
	
	private int StartCoordX;
	private int StartCoordY;
	private int RotationAngel;
	
	private int SelectedPoint;
	private int SelectedNode;
	private int SelectedKeyPoint;
	
	private int lx, ly, hx, hy, vcenter, hcenter;
	
	private boolean NodeConnectorSource;   // true == FROM false == TO
	private int NodeFromTemp;
	
	private int[] GlobalCurveTime; // from TextField
	private int LoopCount;
	
	private Graphics g;
	private Image offi;
	private Dimension offd;
	
	private S2M_GRID_Toolbar s2mGridToolbar;
	private S2M_GridEditor s2mGridEditorMain;
	
	public S2M_GRID_Main()
	{
		Points = new int[MaxPoints][3][NUMBERCURVES];  // x, y, pointtype
		PointCounter = new int[NUMBERCURVES];
		Nodes = new int[MaxNodes][3];	// x, y, nodetype
		NodeConnectors = new int[MaxNodeConnectors][2];   // from, to
		NodeConnectorSource = true;
		NodeFromTemp = NOTSET;
		FreeCurveCoords = new int[MaxFreeCurveCoords][2][NUMBERCURVES];   // x, y 
		FreeCurveCoordCounter = new int[NUMBERCURVES];
		CurveCoords = new int[MaxCurveCoords][4][NUMBERCURVES];  // x, y, keypoint, keypointtime
		CurveCoordCounter = new int[NUMBERCURVES];
		KeyPointCounter = new int[NUMBERCURVES];
		calcIntermPix = true;
		RotationAngel = 0;
		
		GlobalCurveTime = new int[NUMBERCURVES];
		for (int i=0; i<GlobalCurveTime.length; i++)
			GlobalCurveTime[i] = 5*CurveSamplingRate;
		
		LoopCount = LoopCountStandard;
		
		resetCurve();
		resetPlot();
	}
	
	public void resetCurve()
	{
		for (int i=0; i<NUMBERCURVES; i++)
		{
			PointCounter[i] = 0;
			FreeCurveCoordCounter[i] = 0;
			CurveCoordCounter[i] = 0;
			KeyPointCounter[i] = 0;
		}
		
		SelectedPoint = NOTSET;
		SelectedKeyPoint = NOTSET;

		StartCoordX = 0;
		StartCoordY = 0;
		
		lx = 0;
		ly = 0;
		hx = 0;
		hy = 0;
		vcenter = 0;
		hcenter = 0;
		
		for (int i=0; i<Points.length; i++)
		{
			for (int j=0; j<Points[0].length; j++)
			{
				for (int k=0; k<Points[0][0].length; k++)
				{
					Points[i][j][k] = NOTSET;
				}
			}
		}
		
		for (int i=0; i<FreeCurveCoords.length; i++)
		{
			for (int j=0; j<FreeCurveCoords[0].length; j++)
			{
				for (int k=0; k<FreeCurveCoords[0][0].length; k++)
				{
					FreeCurveCoords[i][j][k] = NOTSET;
				}
			}
		}
		
		for (int i=0; i<CurveCoords.length; i++)
		{
			for (int j=0; j<CurveCoords[0].length; j++)
			{
				for (int k=0; k<CurveCoords[0][0].length; k++)
				{
					CurveCoords[i][j][k] = NOTSET;
				}
			}
		}
		
		repaint();
	}
	
	public void resetPlot()
	{
		NodeCounter = 0;
		NodeConnectorCounter = 0;
		
		SelectedNode = NOTSET;

		StartCoordX = 0;
		StartCoordY = 0;
		
		lx = 0;
		ly = 0;
		hx = 0;
		hy = 0;
		vcenter = 0;
		hcenter = 0;
		
		for (int i=0; i<Nodes.length; i++)
		{
			for (int j=0; j<Nodes[0].length; j++)
			{
				Nodes[i][j] = NOTSET;	
			}
		}
		
		for (int i=0; i<NodeConnectors.length; i++)
		{
			for (int j=0; j<NodeConnectors[0].length; j++)
			{
				NodeConnectors[i][j] = NOTSET;	
			}
		}
		
		repaint();
	}
	
	//#############################################################################
	// SETTER & GETTER
	//#############################################################################
	public void setS2MToolbar(S2M_GRID_Toolbar tb)
	{
		s2mGridToolbar = tb;
		s2mGridToolbar.getGlobalTimeTextField().setText(""+GlobalCurveTime[s2mGridToolbar.getActiveCurve()]);
		s2mGridToolbar.getLoopTextField().setText(""+LoopCount);
		s2mGridToolbar.getKeyPointTimeTextField().setText("");
	}
	
	public void setMainObject(S2M_GridEditor ge)
	{
		s2mGridEditorMain = ge;
	}
	
	public static boolean setDelayCompensation(int delay)
	{
		if (delay >= 0 && delay <= MAXDELAY)
		{
			DelayCompensation = delay;
			return true;
		}
		else
			return false;
	}
	
	public static int getDelayCompensation()
	{
		return DelayCompensation;
	}
	
	public static boolean setGridSizeX(int size)
	{
		if (size >= MINGRIDSIZE && size <= MAXGRIDSIZE)
		{
			GridSizeX = size;
			return true;
		}
		else
			return false;
	}
	
	public static boolean setGridSizeY(int size)
	{
		if (size >= MINGRIDSIZE && size <= MAXGRIDSIZE)
		{
			GridSizeY = size;
			return true;
		}
		else
			return false;
	}
	
	public static int getGridSizeX()
	{
		return GridSizeX;
	}
	
	public static int getGridSizeY()
	{
		return GridSizeY;
	}
	
	public boolean setGlobalCurveTime(int time)
	{
		if (time >= calcKeyPointsTime() + CurveSamplingRate)
		{
			GlobalCurveTime[s2mGridToolbar.getActiveCurve()] = time;
			s2mGridToolbar.getGlobalTimeTextField().setText(""+GlobalCurveTime[s2mGridToolbar.getActiveCurve()]);
			return true;
		}
		else
			return false;
	}
	
	public int getGlobalCurveTime()
	{
		return GlobalCurveTime[s2mGridToolbar.getActiveCurve()];
	}
	
	public boolean setLoopCount(int l)
	{
		if (l >= -1)
		{
			LoopCount = l;
			return true;
		}
		else
			return false;
	}
	
	public int getLoopCount()
	{
		return LoopCount;
	}
	
	public Image getGridImage()
	{
		return offi;
	}
	
	public int getGridXmm()
	{
		return GridXmm;
	}
	
	public int getGridYmm()
	{
		return GridYmm;
	}

	public static boolean setCurveSampleRate(int csr)
	{
		if (csr >= 20)
		{
			CurveSamplingRate = csr;
			return true;
		}
		else
			return false;
	}
	
	public int getCurveSampleRate()
	{
		return CurveSamplingRate;
	}
	
	public static boolean setGridXScale(int gxs)
	{
		if (GridXmm > 0)
		{
			GridXmm = gxs;
			return true;
		}
		else
			return false;
	}
	
	public static boolean setGridYScale(int gys)
	{
		if (GridYmm > 0)
		{
			GridYmm = gys;
			return true;
		}
		else
			return false;
	}
	
	public static void setBackgroundColor(Color backgroundColor)
	{
		BackgroundColor = backgroundColor;
	}

	public static void setKeyPointColor(Color keyPointColor) 
	{
		KeyPointColor = keyPointColor;
	}

	public static boolean setKeyPointSize(int keyPointSize) 
	{
		if (keyPointSize >= 1 && keyPointSize <= KeyPointSizeMax)
		{
			KeyPointSize = keyPointSize;
			return false;
		}
		else
			return true;
	}

	public static void setNode1Label(String node1Label) 
	{
		Node1Label = node1Label;
	}

	public static void setNode2Label(String node2Label) 
	{
		Node2Label = node2Label;
	}

	public static void setNode3Label(String node3Label) 
	{
		Node3Label = node3Label;
	}

	public static void setNode4Label(String node4Label) 
	{
		Node4Label = node4Label;
	}

	public static void setNodeConnectorColor(Color nodeConnectorColor) 
	{
		NodeConnectorColor = nodeConnectorColor;
	}

	public static boolean setPointSize(int size)
	{
		if (size >= 1 && size <= PointSizeMax)
		{
			PointSize = size;
			return true;
		}
		else
			return false;
	}
	
	public static boolean setGridSize(int size)
	{
		if (size >= 1 && size <= GridSizeMax)
		{
			GridSize = size;
			return true;
		}
		else
			return false;
	}

	public static void setAutoPointColor(Color color)
	{
		AutoPointColor = color;
	}
	
	public static void setManuPointColor(Color color)
	{
		ManuPointColor = color;
	}
	
	public static void setGridColor(Color color)
	{
		GridColor = color;
	}
	
	public static void setNode1Color(Color color)
	{
		Node1Color = color;
	}

	public static void setNode2Color(Color color)
	{
		Node2Color = color;
	}
	
	public static void setNode3Color(Color color)
	{
		Node3Color = color;
	}
	
	public static void setNode4Color(Color color)
	{
		Node4Color = color;
	}
	
	public static boolean setNodeSize(int size)
	{
		if (size > 0 && size <= NodeSizeMax)
		{
			NodeSize = size;
			return true;
		}
		else
			return false;
	}
	
	public static void setLineColor(Color color)
	{
		LineColor = color;
	}
	//#################################################################################
	// PAINT METHODS
	//#################################################################################
	public void paint(Graphics gr) 
	{	
		// create draw buffer
		Dimension d = getSize();
		if (g == null || d.width != offd.width || d.height != offd.height)
		{
			offd = d;
			offi = createImage(d.width, d.height);
			g = offi.getGraphics();
		}
		
		FontMetrics fm = gr.getFontMetrics();

		// clear screen
		g.setColor(BackgroundColor);
		g.fillRect(0, 0, getWidth()-1, getHeight()-1);

		// draw grid lines and label
		int drawLabel = 0;
		g.setColor(GridColor);
		for (int i=GridSize; i<getWidth(); i+=GridSize)
		{
			if (s2mGridToolbar.getCboGridLineState())
				g.drawLine(i, 0, i, getHeight()-1);
			if (s2mGridToolbar.getCboGridLabelState())
			{
				 if (drawLabel % 2 == 0)
				 {
					 if (s2mGridToolbar.getRbPixelMetricValuesState())
						 g.drawString(""+i, i, 10);
					 else
						 g.drawString(""+(i*GridXmm/10), i, 10);
				 }
				 drawLabel++;
			}
		}
		drawLabel = 0;
		for (int i=GridSize; i<getHeight(); i+=GridSize)
		{
			if (s2mGridToolbar.getCboGridLineState())
				g.drawLine(0, i, getWidth()-1, i);
			if (s2mGridToolbar.getCboGridLabelState())
			{ 
				 if (drawLabel % 2 == 0)
				 {
					 if (s2mGridToolbar.getRbPixelMetricValuesState())
						 g.drawString(""+i, 0, i);
					 else
						 g.drawString(""+(i*GridYmm/10), 0, i);
				 }
				 
				 drawLabel++;
			}
		}
		
		// draw node connector
		if (s2mGridToolbar.getCboNodeConnectorState())
		{
			g.setColor(NodeConnectorColor);
			for (int i=0; i<NodeConnectorCounter; i++)
			{
				g.drawLine(Nodes[NodeConnectors[i][FROM]][X]+NodeSize/2, Nodes[NodeConnectors[i][FROM]][Y]+NodeSize/2, 
					Nodes[NodeConnectors[i][TO]][X]+NodeSize/2, Nodes[NodeConnectors[i][TO]][Y]+NodeSize/2);
			}
		}
		
		// draw the nodes
		int node1counter = 0, node2counter = 0, node3counter = 0, node4counter = 0;
		for (int i=0; i<NodeCounter; i++)
		{
			if (Nodes[i][NODECOLOR] == NODE1)
			{
				node1counter++;
				g.setColor(Node1Color);
				if (s2mGridToolbar.getCboNode1State())
					g.fillRect(Nodes[i][X], Nodes[i][Y], NodeSize, NodeSize);
				if (s2mGridToolbar.getCboNodeLabelState())
				{
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						g.drawString(""+Node1Label+" "+node1counter, Nodes[i][X]-4, Nodes[i][Y]-2);
					else
						g.drawString(""+Node1Label+" "+node1counter, Nodes[i][X]-4, Nodes[i][Y]-2);
				}
			}
			else if (Nodes[i][NODECOLOR] == NODE2)
			{
				node2counter++;
				g.setColor(Node2Color);
				if (s2mGridToolbar.getCboNode2State())
					g.fillRect(Nodes[i][X], Nodes[i][Y], NodeSize, NodeSize);
				if (s2mGridToolbar.getCboNodeLabelState())
				{
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						g.drawString(""+Node2Label+" "+node2counter, Nodes[i][X]-4, Nodes[i][Y]-2);
					else
						g.drawString(""+Node2Label+" "+node2counter, Nodes[i][X]-4, Nodes[i][Y]-2);
				}
			}
			else if (Nodes[i][NODECOLOR] == NODE3)
			{
				node3counter++;
				g.setColor(Node3Color);
				if (s2mGridToolbar.getCboNode3State())
					g.fillRect(Nodes[i][X], Nodes[i][Y], NodeSize, NodeSize);
				if (s2mGridToolbar.getCboNodeLabelState())
				{
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						g.drawString(""+Node3Label+" "+node3counter, Nodes[i][X]-4, Nodes[i][Y]-2);
					else
						g.drawString(""+Node3Label+" "+node3counter, Nodes[i][X]-4, Nodes[i][Y]-2);
				}
			}
			else if (Nodes[i][NODECOLOR] == NODE4)
			{
				node4counter++;
				g.setColor(Node4Color);
				if (s2mGridToolbar.getCboNode4State())
					g.fillRect(Nodes[i][X], Nodes[i][Y], NodeSize, NodeSize);
				if (s2mGridToolbar.getCboNodeLabelState())
				{
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						g.drawString(""+Node4Label+" "+node4counter, Nodes[i][X]-4, Nodes[i][Y]-2);
					else
						g.drawString(""+Node4Label+" "+node4counter, Nodes[i][X]-4, Nodes[i][Y]-2);
				}
			}
			
			// draw Node Positions
			if (s2mGridToolbar.getCboNodePositionState())
			{
				String s;
				if (s2mGridToolbar.getRbPixelMetricValuesState())
					s = ""+Nodes[i][X]+"/"+Nodes[i][Y];
				else
					s = ""+Nodes[i][X]*GridXmm/10+"/"+Nodes[i][Y]*GridYmm/10;
				
				g.drawString(s, Nodes[i][X]-4, Nodes[i][Y]+NodeSize+fm.getHeight()-2);
			}
		}
			
		// draw the curves
		if (s2mGridToolbar.getCboCurveState())
		{
			for (int i=0; i<NUMBERCURVES; i++)
			{
				// draw manu curve
				if (PointCounter[i] > 0)
				{
					g.setColor(LineColor);
					if (PointCounter[i] < MINPOINTS || Points[0][POINTTYPE][i] == PTMANU)
					{
						if (calcIntermPix)
							CurveCoordCounter[i] = 0;
						
						for (int j=0; j<PointCounter[i]-1; j++)
						{
							int xstart = Points[j][X][i]+PointSize/2;
							int ystart = Points[j][Y][i]+PointSize/2;
							int xend = Points[j+1][X][i]+PointSize/2;
							int yend = Points[j+1][Y][i]+PointSize/2;
							g.drawLine(xstart, ystart, xend, yend);
							if (calcIntermPix)
								calcIntermediatePixels(i, xstart, ystart, xend, yend);
						}
					}
					else
					{
						// draw auto bezier curve
				        if (calcIntermPix)
				        	CurveCoordCounter[i] = 0;
				        	
						drawCurve(g, Points, i, PointCounter, CurveDivisor, CURVEITERATOR);
						
						sortCurveCoords(i);
					}
				}
			}
		}
		
		// draw freehand curve
		if (s2mGridToolbar.getCboCurveState())
		{
			for (int i=0; i<NUMBERCURVES; i++)
			{
				if (FreeCurveCoordCounter[i] > 0)
				{
					g.setColor(LineColor);
					
					if (calcIntermPix)
						CurveCoordCounter[i] = 0;
					
					for (int j = 0; j<FreeCurveCoordCounter[i]-1; j++)
					{				
						int xstart = FreeCurveCoords[j][X][i];
						int ystart = FreeCurveCoords[j][Y][i];
						int xend = FreeCurveCoords[j+1][X][i];
						int yend = FreeCurveCoords[j+1][Y][i];
						g.drawLine(xstart, ystart, xend, yend);
						if (calcIntermPix)
							calcIntermediatePixels(i, xstart, ystart, xend, yend);
					}
				}
			}
		}
		
		// draw freehand start end point
		for (int i=0; i<NUMBERCURVES; i++)
		{
			if (FreeCurveCoordCounter[i] > 0)
			{
				if (s2mGridToolbar.getCboSupportPointState())
				{
					g.drawRect(FreeCurveCoords[0][X][i]-PointSize/2, FreeCurveCoords[0][Y][i]-PointSize/2, PointSize, PointSize);
					g.fillRect(FreeCurveCoords[FreeCurveCoordCounter[i]-1][X][i]-PointSize/2, FreeCurveCoords[FreeCurveCoordCounter[i]-1][Y][i]-PointSize/2, PointSize, PointSize);
				}
				// draw freehand start end point pos
				if (s2mGridToolbar.getCboSupportPointPositionState())
				{
					String s;
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						s = ""+FreeCurveCoords[0][X][i]+"/"+FreeCurveCoords[0][Y][i];
					else
						s = ""+FreeCurveCoords[0][X][i]*GridXmm/10+"/"+FreeCurveCoords[0][Y][i]*GridYmm/10;
					
					g.drawString(s, FreeCurveCoords[0][X][i]-PointSize*2, FreeCurveCoords[0][Y][i]-PointSize);
					
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						s = ""+FreeCurveCoords[FreeCurveCoordCounter[i]-1][X][i]+"/"+FreeCurveCoords[FreeCurveCoordCounter[i]-1][Y][i];
					else
						s = ""+FreeCurveCoords[FreeCurveCoordCounter[i]-1][X][i]*GridXmm/10+"/"+FreeCurveCoords[FreeCurveCoordCounter[i]-1][Y][i]*GridYmm/10;
					
					g.drawString(s, FreeCurveCoords[FreeCurveCoordCounter[i]-1][X][i]-PointSize*2, FreeCurveCoords[FreeCurveCoordCounter[i]-1][Y][i]-PointSize);
					
					// draw curve number
					s = "C"+(i+1);
					g.drawString(s, FreeCurveCoords[0][X][i]-2, FreeCurveCoords[0][Y][i]+PointSize+fm.getHeight()-4);
					
					// drwaw global curve time
					s = ""+GlobalCurveTime[s2mGridToolbar.getActiveCurve()]+"ms";
					g.drawString(s, FreeCurveCoords[FreeCurveCoordCounter[i]-1][X][i]-8, FreeCurveCoords[FreeCurveCoordCounter[i]-1][Y][i]+PointSize+fm.getHeight()-4);
				}
			}
		}
		
		// draw keypoints
		for (int i=0; i<NUMBERCURVES; i++)
		{
			if (KeyPointCounter[i] > 0)
			{
				for (int j=0; j<CurveCoordCounter[i]; j++)
				{
					g.setColor(KeyPointColor);
					if (CurveCoords[j][POINTTYPE][i] == ISKEYPOINT)
					{
						Polygon p = new Polygon();
						p.addPoint(CurveCoords[j][X][i]-KeyPointSize/2, CurveCoords[j][Y][i]);
						p.addPoint(CurveCoords[j][X][i], CurveCoords[j][Y][i]-KeyPointSize/2);
						p.addPoint(CurveCoords[j][X][i]+KeyPointSize/2, CurveCoords[j][Y][i]);
						p.addPoint(CurveCoords[j][X][i], CurveCoords[j][Y][i]+KeyPointSize/2);
						if (j == SelectedKeyPoint)
						{
							g.drawPolygon(p);
							setKeyPointTime(CurveCoords[SelectedKeyPoint][KEYTIME][i]);
						}
						else
							g.fillPolygon(p);
						
					}
					// draw keypoint position and keypoint time
					if (s2mGridToolbar.getCboKeyPointPositionState())
					{
						if (CurveCoords[j][POINTTYPE][i] == ISKEYPOINT)
						{
							String s;
							if (s2mGridToolbar.getRbPixelMetricValuesState())
								s = ""+CurveCoords[j][X][i]+"/"+CurveCoords[j][Y][i];
							else
								s = ""+CurveCoords[j][X][i]*GridXmm/10+"/"+CurveCoords[j][Y][i]*GridYmm/10;
							
							g.drawString(s, CurveCoords[j][X][i]-KeyPointSize*2, CurveCoords[j][Y][i]-KeyPointSize/2);
							
							s = ""+CurveCoords[j][KEYTIME][i]+"ms";
							g.drawString(s, CurveCoords[j][X][i]-KeyPointSize/2-8, CurveCoords[j][Y][i]+KeyPointSize/2+fm.getHeight()-4);
						}
					}
				}
			}
		}
		
		// draw the support points
		for (int i=0; i<NUMBERCURVES; i++)
		{
			for (int j=0; j<PointCounter[i]; j++)
			{
				if (Points[j][POINTTYPE][i] == PTAUTO)
					g.setColor(AutoPointColor);
				else if (Points[j][POINTTYPE][i] == PTMANU)
					g.setColor(ManuPointColor);
				
				if (s2mGridToolbar.getCboSupportPointState())
				{
					if (j == 0)
						g.drawRect(Points[j][X][i], Points[j][Y][i], PointSize, PointSize);
					else
						g.fillRect(Points[j][X][i], Points[j][Y][i], PointSize, PointSize);
				}
				
				// draw support point positions
				if (s2mGridToolbar.getCboSupportPointPositionState())
				{
					String s;
					if (s2mGridToolbar.getRbPixelMetricValuesState())
						s = ""+Points[j][X][i]+"/"+Points[j][Y][i];
					else
						s = ""+Points[j][X][i]*GridXmm/10+"/"+Points[j][Y][i]*GridYmm/10;
					
					g.drawString(s, Points[j][X][i]-4, Points[j][Y][i]-2);
					
					// draw curve number
					if (j == 0)
					{
						s = "C"+(i+1);
						g.drawString(s, Points[j][X][i], Points[j][Y][i]+PointSize+2+fm.getHeight()-4);
					}
					// drwaw global curve time
					if (PointCounter[i] > 1 && j == PointCounter[i]-1)
					{
						s = ""+GlobalCurveTime[s2mGridToolbar.getActiveCurve()]+"ms";
						g.drawString(s, Points[j][X][i]-6, Points[j][Y][i]+PointSize+2+fm.getHeight()-4);
					}
				}
			}
		}
		
		// test bounds rect // TODO only test remove
		//g.setColor(Color.YELLOW);
		//g.drawRect(lx, ly, hx-lx, hy-ly);
		
		// draw buffer
		gr.drawImage(offi, 0, 0, this);
	}
	
	public void update(Graphics gr) 
	{
		paint(gr);
	}

	//#########################################################################
	// INTERNAL CALCULATION METHODS
	//#########################################################################
	private int max(int a, int b)
	{
		if (a > b)
			return a;
		else
			return b;
	}
	
	private int min(int a, int b)
	{
		if (a < b)
			return a;
		else
			return b;
	}
	
	private void sortCurveCoords(int curve)
	{ 
		for(int i=0; i<CurveCoordCounter[curve]-1; i++) 
		{  
			if (max(CurveCoords[i][X][curve], CurveCoords[i+1][X][curve]) - min(CurveCoords[i][X][curve], CurveCoords[i+1][X][curve]) <= 1 &&
				max(CurveCoords[i][Y][curve], CurveCoords[i+1][Y][curve]) - min(CurveCoords[i][Y][curve], CurveCoords[i+1][Y][curve]) <= 1)
			{
				// ok, do nothing
			}
			else
			{
				// find next element
				for (int j=i+1; j<CurveCoordCounter[curve]; j++)
				{
					if (max(CurveCoords[i][X][curve], CurveCoords[j][X][curve]) - min(CurveCoords[i][X][curve], CurveCoords[j][X][curve]) <= 1 &&
						max(CurveCoords[i][Y][curve], CurveCoords[j][Y][curve]) - min(CurveCoords[i][Y][curve], CurveCoords[j][Y][curve]) <= 1)
					{
						int tempx = CurveCoords[i+1][X][curve];
						int tempy = CurveCoords[i+1][Y][curve];
						
						CurveCoords[i+1][X][curve] = CurveCoords[j][X][curve];
						CurveCoords[i+1][Y][curve] = CurveCoords[j][Y][curve];
						
						CurveCoords[j][X][curve] = tempx;
						CurveCoords[j][Y][curve] = tempy;
						
						break;
					}
				}
			}
		}
	}
	
		// bezier curve recursive
	private void drawCurve (Graphics g, int[][][] points, int curve, int[] pointcount, double t, int iter)
	{
		int n = pointcount[curve] - 1;

		int[][][] q = new int[n+1][n+1][2];

		for (int i = 0; i < n+1; i++)
		{
			if (iter == CURVEITERATOR)
			{
				q[i][0][X] = points[i][X][curve]+PointSize/2;
				q[i][0][Y] = points[i][Y][curve]+PointSize/2;
			}
			else
			{
				q[i][0][X] = points[i][X][curve];
				q[i][0][Y] = points[i][Y][curve];				
			}
		}

		for (int j = 1; j <= n; j++)
		{
		    for (int i = 0; i <= (n-j); i++)
		    {
		      q[i][j][X] = (int) ((1 - t) * q[i][j - 1][X] + t * q[i + 1][j - 1][X]);
		      q[i][j][Y] = (int) ((1 - t) * q[i][j - 1][Y] + t * q[i + 1][j - 1][Y]);
		    }
		}

	  	int[][][] c1 = new int[n+1][n+1][NUMBERCURVES];
	  	int[][][] c2 = new int[n+1][n+1][NUMBERCURVES];

	    for (int i=0;i<n+1;i++)
	    {
	    	c1[i][X][curve] = q[0][i][X];
	    	c1[i][Y][curve] = q[0][i][Y];
	    	c2[i][X][curve] = q[i][n-i][X];
	    	c2[i][Y][curve] = q[i][n-i][Y];
	    }

	    if(iter >= 0)
	    {
	    	drawCurve(g, c1, curve, pointcount, t, --iter);
	      	drawCurve(g, c2, curve, pointcount, t, --iter);
	    }
	    else
	    {
	    	for (int i=0; i<n; i++)
	    	{
		        int b1x1 = (int) Math.round(q[0][i][X]);
		        int b1y1 = (int) Math.round(q[0][i][Y]);
		        int b1x2 = (int) Math.round(q[0][i+1][X]);
		        int b1y2 = (int) Math.round(q[0][i+1][Y]);
	
		        int b2x1 = (int) Math.round(q[i][n-i][X]);
		        int b2y1 = (int) Math.round(q[i][n-i][Y]);
		        int b2x2 = (int) Math.round(q[i+1][n-i-1][X]);
		        int b2y2 = (int) Math.round(q[i+1][n-i-1][Y]);
	
		        if (calcIntermPix)
		        {
		        	calcIntermediatePixels(curve, b1x1, b1y1, b1x2, b1y2);
		        	calcIntermediatePixels(curve, b2x1, b2y1, b2x2, b2y2);
		        }
		        
		        g.drawLine(b1x1, b1y1, b1x2, b1y2);
		        g.drawLine(b2x1, b2y1, b2x2, b2y2);
	    	}
	    }
	}
	
	private boolean resizeCurveCoordArray(int value)
	{
		int size1 = CurveCoords.length;
		int size2 = CurveCoords[0].length;
		
		int[][][] temp = new int[size1][size2][NUMBERCURVES];
		
		for (int curve=0; curve<NUMBERCURVES; curve++)
		{
			for (int i=0; i<size1; i++)
			{
				for (int j=0; j<size2; j++)
					temp[i][j][curve] = CurveCoords[i][j][curve];
			}
		}
		
		CurveCoords = new int[size1+value][size2][NUMBERCURVES];
		
		for (int curve=0; curve<NUMBERCURVES; curve++)
		{
			for (int i=0; i<size1; i++)
			{
				for (int j=0; j<size2; j++)
					CurveCoords[i][j][curve] = temp[i][j][curve];
			}
		}
		return true;
	}
	
	public boolean resizePointsArray(int value)  // TODO
	{
		return true;
	}
	
	public boolean resizeFreeCurveArray(int value)
	{
		return true;
	}
	
	public boolean resizeNodesArray(int value)
	{
		return true;
	}
	
	public boolean resizeNodeConnectorsArray(int value)
	{
		return true;
	}
	
	private void calcIntermediatePixels(int curve, int xstart, int ystart, int xend, int yend)
	{
		int x, y, t, dist, xerr, yerr, dx, dy, incx, incy, pcount;
		
		// calc distance
		dx = xend - xstart;
		dy = yend - ystart;
		
		// determine sign of increment
		if(dx < 0){incx = -1;dx = -dx;}
	    else if(dx > 0){incx = 1;}
	    else{incx = 0;}
	     
	    if(dy < 0){incy = -1;dy = -dy;}
	    else if(dy > 0){incy = 1;}
	    else{incy = 0;}
	    
	    // determine greater distance
	    dist = (dx > dy) ? dx : dy;
	    
	    // some initialization
	    x = xstart;
	    y = ystart;
	    xerr = dx;
	    yerr = dy;
	    pcount = dist + 1;
	    
	    // calc pixels
	    for(t = 0; t < dist; t++)
		{
	       boolean redo = false;
	       do
	       {
		       try
		       {
				   CurveCoords[CurveCoordCounter[curve]][X][curve] = x;
				   CurveCoords[CurveCoordCounter[curve]][Y][curve] = y;
				   CurveCoordCounter[curve]++;
				   redo = false;
		       }
		       catch(ArrayIndexOutOfBoundsException e)
		       {
		    	   resizeCurveCoordArray(CURVECOORDRESIZEVALUE);
		    	   redo = true;
		       }
	       }while(redo == true);
		 
		   xerr += dx;
		   yerr += dy;
		 
		   if(xerr > dist)
		   {
		     xerr -= dist;
		     x += incx;
		   }
		 
		   if(yerr>dist)
		   {
		     yerr -= dist;
		     y += incy;
		   }
		}
		 
       boolean redo = false;
       do
       {
	       try
	       {
			   CurveCoords[CurveCoordCounter[curve]][X][curve] = xend;
			   CurveCoords[CurveCoordCounter[curve]][Y][curve] = yend;
			   CurveCoordCounter[curve]++;
			   redo = false;
	       }
	       catch(ArrayIndexOutOfBoundsException e)
	       {
	    	   resizeCurveCoordArray(CURVECOORDRESIZEVALUE);
	    	   redo = true;
	       }
       }while(redo == true);
	}

	//#######################################################################################
	// SUPPORT POINT METHODS
	//#######################################################################################
	public void addPoint(int type, int x, int y)
	{
		if (FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()] == 0)
		{
			if (type == PTAUTO || type == PTMANU)
			{
				if (PointCounter[s2mGridToolbar.getActiveCurve()] == 0 || Points[0][POINTTYPE][s2mGridToolbar.getActiveCurve()] == type)
				{
					if (hitTestPoint(x, y) == NOTSET)
					{
				       boolean redo = false;
				       do
				       {
					       try
					       {
								Points[PointCounter[s2mGridToolbar.getActiveCurve()]][X][s2mGridToolbar.getActiveCurve()] = x - PointSize/2;  // store center coords
								Points[PointCounter[s2mGridToolbar.getActiveCurve()]][Y][s2mGridToolbar.getActiveCurve()] = y - PointSize/2;
								Points[PointCounter[s2mGridToolbar.getActiveCurve()]][POINTTYPE][s2mGridToolbar.getActiveCurve()] = type;
								PointCounter[s2mGridToolbar.getActiveCurve()]++;
							    redo = false;
					       }
					       catch(ArrayIndexOutOfBoundsException e)
					       {
					    	    resizePointsArray(POINTSRESIZEVALUE);
					    	    redo = true;
					       }
				       }while(redo == true);
					}
					repaint();
				}
			}
		}
	}
	
	public boolean removePoint(int x, int y)
	{	
		SelectedPoint = hitTestPoint(x, y);
		
		if (SelectedPoint != -1)
		{
			PointCounter[s2mGridToolbar.getActiveCurve()]--;
			for (int i=SelectedPoint; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				Points[i][X][s2mGridToolbar.getActiveCurve()] = Points[i+1][X][s2mGridToolbar.getActiveCurve()];
				Points[i][Y][s2mGridToolbar.getActiveCurve()] = Points[i+1][Y][s2mGridToolbar.getActiveCurve()];
			}
			Points[PointCounter[s2mGridToolbar.getActiveCurve()]][X][s2mGridToolbar.getActiveCurve()] = NOTSET;
			Points[PointCounter[s2mGridToolbar.getActiveCurve()]][Y][s2mGridToolbar.getActiveCurve()] = NOTSET;
			SelectedPoint = NOTSET;
			repaint();
			return true;
		}
		return false;
	}
	
	private int hitTestPoint(int x, int y)
	{
		for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
		{				
			if ((x >= Points[i][X][s2mGridToolbar.getActiveCurve()]-PointSize/2 && x <= Points[i][X][s2mGridToolbar.getActiveCurve()]+PointSize+PointSize/2) &&
				(y >= Points[i][Y][s2mGridToolbar.getActiveCurve()]-PointSize/2 && y <= Points[i][Y][s2mGridToolbar.getActiveCurve()]+PointSize+PointSize/2))
			{
				return i;
			}
		}
		return NOTSET;
	}
	
	public boolean selectPoint(int x, int y)
	{
		SelectedPoint = hitTestPoint(x, y);
		
		if (SelectedPoint != -1)
			return true;
		else
			return false;
	}
	
	public void movePoint(int x, int y)
	{		
		// check bounds
		if (SelectedPoint != -1 && x >= 0 && x < getWidth()-PointSize &&
				                   y >= 0 && y < getHeight()-PointSize)
		{
			Points[SelectedPoint][X][s2mGridToolbar.getActiveCurve()] = x;
			Points[SelectedPoint][Y][s2mGridToolbar.getActiveCurve()] = y;
			repaint();
		}
	}
	
	public void releasePoint()
	{
		SelectedPoint = -1;
		repaint();
	}
	
	//######################################################################################
	// MOTION CURVE METHODS
	//######################################################################################
	public void setStartCoords(int x, int y)
	{
		StartCoordX = x;
		StartCoordY = y;
	}
	
	public void drawFreehand(int x, int y)
	{
		if (PointCounter[s2mGridToolbar.getActiveCurve()] == 0)
		{
	        boolean redo = false;
	        do
	        {
		        try
		        {
					FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]][X][s2mGridToolbar.getActiveCurve()] = StartCoordX;
					FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]][Y][s2mGridToolbar.getActiveCurve()] = StartCoordY;
					FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]++;
				    redo = false;
		        }
		        catch(ArrayIndexOutOfBoundsException e)
		        {
		    	    resizeFreeCurveArray(FREECURVERESIZEVALUE);
		    	    redo = true;
		        }
	        }while(redo == true);
	
			setStartCoords(x, y);
			repaint();
		}
	}
	
	public void eraseFreehand(int x, int y)  
	{   
		// can erase last point only!!!
		if ((x >= FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]-1][X][s2mGridToolbar.getActiveCurve()]-8 && 
			 x <= FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]-1][X][s2mGridToolbar.getActiveCurve()]+8) &&
		    (y >= FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]-1][Y][s2mGridToolbar.getActiveCurve()]-8 && 
		     y <= FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]-1][Y][s2mGridToolbar.getActiveCurve()]+8))
		{
			FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]-1][X][s2mGridToolbar.getActiveCurve()] = NOTSET;
			FreeCurveCoords[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]-1][Y][s2mGridToolbar.getActiveCurve()] = NOTSET;
			FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]--;
			
			setStartCoords(x, y);
			repaint();
		}
	}
	
	public void calcCurveBounds()
	{
		lx = getWidth();
		ly = getHeight();
		hx = 0;
		hy = 0;
		
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0)  // calc bounds from support points
		{
			for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{		
				if (Points[i][X][s2mGridToolbar.getActiveCurve()] < lx)
					lx = Points[i][X][s2mGridToolbar.getActiveCurve()];
				if (Points[i][X][s2mGridToolbar.getActiveCurve()] > hx)
					hx = Points[i][X][s2mGridToolbar.getActiveCurve()];
				
				if (Points[i][Y][s2mGridToolbar.getActiveCurve()] < ly)
					ly = Points[i][Y][s2mGridToolbar.getActiveCurve()];
				if (Points[i][Y][s2mGridToolbar.getActiveCurve()] > hy)
					hy = Points[i][Y][s2mGridToolbar.getActiveCurve()];
			}
		}
		else if (FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()] > 0)  // calc bounds from freehand curve coords
		{
			for (int i=0; i<FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				if (FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()] < lx)
					lx = FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()];
				if (FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()] > hx)
					hx = FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()];
				
				if (FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()] < ly)
					ly = FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()];
				if (FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()] > hy)
					hy = FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()];
			}
		}
			
		// calc center
		vcenter = lx + ((hx-lx) /2);
		hcenter = ly + ((hy-ly) /2);
	}
	
	public void moveCurve(int x, int y)
	{	
		calcCurveBounds();
		
		// check bounds
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0 &&((lx += x - StartCoordX) >= 0 && (hx += x - StartCoordX+PointSize) < getWidth()) &&
		   ((ly += y - StartCoordY) >= 0 && (hy += y - StartCoordY+PointSize) < getHeight()) ||
		   (FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()] > 0 &&((lx += x - StartCoordX) >= 0 && (hx += x - StartCoordX) < getWidth()) &&
		   ((ly += y - StartCoordY) >= 0 && (hy += y - StartCoordY) < getHeight())))
		{
			if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0)  // move path curve
			{
				for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
				{			
					Points[i][X][s2mGridToolbar.getActiveCurve()] += x - StartCoordX;
					Points[i][Y][s2mGridToolbar.getActiveCurve()] += y - StartCoordY;
				}
			}
			else if (FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()] > 0)  // move free curve
			{
				for (int i=0; i<FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]; i++)
				{			
					FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()] += x - StartCoordX;
					FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()] += y - StartCoordY;
				}
			}
			setStartCoords(x, y);
			repaint();
		}
	}
	
	public void convertCurve()  // covert manupath to autopath and vice versa
	{
		int action = 0;
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0 && Points[0][POINTTYPE][s2mGridToolbar.getActiveCurve()] == PTAUTO)
			action = 1;
		else if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0 && Points[0][POINTTYPE][s2mGridToolbar.getActiveCurve()] == PTMANU)
			action = 2;
		
		for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
		{
			if (action == 1)
				Points[i][POINTTYPE][s2mGridToolbar.getActiveCurve()] = PTMANU;
			else if (action == 2)
				Points[i][POINTTYPE][s2mGridToolbar.getActiveCurve()] = PTAUTO;
		}
		repaint();
	}
	
	public void warpCurve(int x, int y)
	{
		calcCurveBounds();
			
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0)
		{
			for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				if (x != StartCoordX)
				{
					if (i < PointCounter[s2mGridToolbar.getActiveCurve()]/2)
						Points[i][X][s2mGridToolbar.getActiveCurve()] += x - StartCoordX;
					else if (i >= PointCounter[s2mGridToolbar.getActiveCurve()]/2)
						Points[i][X][s2mGridToolbar.getActiveCurve()] -= x - StartCoordX;
				}
	
				if (y != StartCoordY)
				{
					if (i < PointCounter[s2mGridToolbar.getActiveCurve()]/2)
							Points[i][Y][s2mGridToolbar.getActiveCurve()] += y - StartCoordY;
					else if (i >= PointCounter[s2mGridToolbar.getActiveCurve()]/2)
							Points[i][Y][s2mGridToolbar.getActiveCurve()] -= y - StartCoordY;
				}
			}
		}
		setStartCoords(x, y);
		repaint();
	}
	
	public void scaleCurve(int x, int y)
	{
		calcCurveBounds();
		
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0)
		{
			for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				if (Points[i][X][s2mGridToolbar.getActiveCurve()] >= vcenter)
					Points[i][X][s2mGridToolbar.getActiveCurve()] += x - StartCoordX;
				else if (Points[i][X][s2mGridToolbar.getActiveCurve()] < vcenter)
					Points[i][X][s2mGridToolbar.getActiveCurve()] -= x - StartCoordX;
	
				if (Points[i][Y][s2mGridToolbar.getActiveCurve()] >= hcenter)
					Points[i][Y][s2mGridToolbar.getActiveCurve()] -= y - StartCoordY;
				else if (Points[i][Y][s2mGridToolbar.getActiveCurve()] < hcenter)
					Points[i][Y][s2mGridToolbar.getActiveCurve()] += y - StartCoordY;
			}
		}

		setStartCoords(x, y);
		repaint();
	}
	
	public void copyCurvePoints()
	{
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0)
		{
			CopyPoints = new int[PointCounter[s2mGridToolbar.getActiveCurve()]][2];
			
			for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				CopyPoints[i][X] = Points[i][X][s2mGridToolbar.getActiveCurve()];
				CopyPoints[i][Y] = Points[i][Y][s2mGridToolbar.getActiveCurve()];
			}
		}
		else if (FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()] > 0)
		{
			CopyPoints = new int[FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]][2];
			
			for (int i=0; i<FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				CopyPoints[i][X] = FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()];
				CopyPoints[i][Y] = FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()];
			}
		}
	}
	
	public void rotateCurve(int x, int y)
	{		
		if (x > StartCoordX || y > StartCoordY)
		{
			RotationAngel = RotationAngel + (x-StartCoordX > y-StartCoordY ? x-StartCoordX : y-StartCoordY);
			if (RotationAngel > 359)
				RotationAngel = RotationAngel - 360;
		}
		else if (x < StartCoordX || y < StartCoordY)
		{
			RotationAngel = RotationAngel - (StartCoordX-x > StartCoordY-y ? StartCoordX-x : StartCoordY-y);
			if (RotationAngel < 0)
				RotationAngel = RotationAngel + 360;
		}
		
		if (PointCounter[s2mGridToolbar.getActiveCurve()] > 0)
		{
			for (int i=0; i<PointCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				Points[i][X][s2mGridToolbar.getActiveCurve()] -= vcenter;	CopyPoints[i][X] -= vcenter;
				Points[i][Y][s2mGridToolbar.getActiveCurve()] -= hcenter;	CopyPoints[i][Y] -= hcenter;
				Points[i][X][s2mGridToolbar.getActiveCurve()] = (int) (Math.cos(Math.toRadians(RotationAngel)) * CopyPoints[i][X] + Math.sin(Math.toRadians(RotationAngel)) * CopyPoints[i][Y]);
				Points[i][Y][s2mGridToolbar.getActiveCurve()] = (int) (-Math.sin(Math.toRadians(RotationAngel)) * CopyPoints[i][X] + Math.cos(Math.toRadians(RotationAngel)) * CopyPoints[i][Y]);
				Points[i][X][s2mGridToolbar.getActiveCurve()] += vcenter;	CopyPoints[i][X] += vcenter;
				Points[i][Y][s2mGridToolbar.getActiveCurve()] += hcenter;	CopyPoints[i][Y] += hcenter;
			}
		}
		else if (FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()] > 0)
		{
			for (int i=0; i<FreeCurveCoordCounter[s2mGridToolbar.getActiveCurve()]; i++)
			{
				FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()] -= vcenter;	CopyPoints[i][X] -= vcenter;
				FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()] -= hcenter;	CopyPoints[i][Y] -= hcenter;
				FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()] = (int) (Math.cos(Math.toRadians(RotationAngel)) * CopyPoints[i][X] + Math.sin(Math.toRadians(RotationAngel)) * CopyPoints[i][Y]);
				FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()] = (int) (-Math.sin(Math.toRadians(RotationAngel)) * CopyPoints[i][X] + Math.cos(Math.toRadians(RotationAngel)) * CopyPoints[i][Y]);
				FreeCurveCoords[i][X][s2mGridToolbar.getActiveCurve()] += vcenter;	CopyPoints[i][X] += vcenter;
				FreeCurveCoords[i][Y][s2mGridToolbar.getActiveCurve()] += hcenter;	CopyPoints[i][Y] += hcenter;
			}
		}
		setStartCoords(x, y);
		repaint();
	}
 

Nicole81

Aktives Mitglied
hier noch der rest wen es interessiert^^

Code:
	//##############################################################################################
	// KEYPOINT METHODS
	//##############################################################################################
	public int calcKeyPointsTime()
	{
		int time = 0;
		for (int i = 0; i < CurveCoordCounter[s2mGridToolbar.getActiveCurve()]; i++)
		{
			if (CurveCoords[i][POINTTYPE][s2mGridToolbar.getActiveCurve()] == ISKEYPOINT)
				time += CurveCoords[i][KEYTIME][s2mGridToolbar.getActiveCurve()];
		}
		return time;
	}
	
	private int hitTestCurveCoord(int x, int y)
	{
		for (int i=0; i<CurveCoordCounter[s2mGridToolbar.getActiveCurve()]; i++)
		{
			if (x >= CurveCoords[i][X][s2mGridToolbar.getActiveCurve()]-5 && 
				x <= CurveCoords[i][X][s2mGridToolbar.getActiveCurve()]+5 &&
				y >= CurveCoords[i][Y][s2mGridToolbar.getActiveCurve()]-5 && 
				y <= CurveCoords[i][Y][s2mGridToolbar.getActiveCurve()]+5)
				{
					return i;
				}
		}
		return NOTSET;
	}
	
	private int hitTestKeyPoint(int x, int y) 
	{
		int SelectedCoord = hitTestCurveCoord(x, y);
		
		if (SelectedCoord != -1)
		{
			for (int i = SelectedCoord - KeyPointSize; i < SelectedCoord + KeyPointSize; i++)
			{
				if (CurveCoords[i][POINTTYPE][s2mGridToolbar.getActiveCurve()] == ISKEYPOINT)
					return i;
			}
			return NOTSET;
		}
		return NOTSET;
	}
	
	public boolean addKeyPoint(int x, int y)  
	{
		int CurveCoord = hitTestCurveCoord(x, y);
		
		SelectedKeyPoint = hitTestKeyPoint(x, y);
		
		if (CurveCoord != NOTSET && SelectedKeyPoint == NOTSET)
		{
			CurveCoords[CurveCoord][POINTTYPE][s2mGridToolbar.getActiveCurve()] = ISKEYPOINT;
			CurveCoords[CurveCoord][KEYTIME][s2mGridToolbar.getActiveCurve()] = CurveSamplingRate;
			KeyPointCounter[s2mGridToolbar.getActiveCurve()]++;
			
			s2mGridToolbar.getKeyPointTimeTextField().setText(""+CurveSamplingRate);
			int time = calcKeyPointsTime() + CurveSamplingRate;
			if (time > GlobalCurveTime[s2mGridToolbar.getActiveCurve()])
				setGlobalCurveTime(time);

			SelectedKeyPoint = CurveCoord;
			repaint();
			return true;
		}
		return false;
	}
	
	public boolean removeKeyPoint(int x, int y)
	{
		SelectedKeyPoint = hitTestKeyPoint(x, y);
		
		if (SelectedKeyPoint != NOTSET)
		{
			CurveCoords[SelectedKeyPoint][POINTTYPE][s2mGridToolbar.getActiveCurve()] = NOTSET;
			CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()] = NOTSET;
			KeyPointCounter[s2mGridToolbar.getActiveCurve()]--;
			repaint();
			return true;
		}
		return false;
	}
	
	public int checkKeyPointNeighbourhood(int startindex, int dist)
	{
		for (int i = startindex - KeyPointDistance - dist; i < startindex + KeyPointDistance + dist; i++)
		{
			if (i < CurveCoordCounter[s2mGridToolbar.getActiveCurve()] && i >= 0 && i != startindex)
			{
				if (CurveCoords[i][POINTTYPE][s2mGridToolbar.getActiveCurve()] == ISKEYPOINT)
				{
					if (i < startindex)
						return 1;  // links ok
					else if (i > startindex)
						return 2; // rechts ok
				}
			}
		}
		return NOTSET;  // alle ok 
	}
	
	public boolean moveKeyPoint(int x, int y)
	{	
		if (SelectedKeyPoint != -1)
		{
			int dx, dy, dist = 0;
			if (x > StartCoordX || y < StartCoordY)
			{
				dx = x - StartCoordX; dy = StartCoordY - y;
				dist = (dx > dy) ?  dx : dy;
				int check = checkKeyPointNeighbourhood(SelectedKeyPoint, dist);
				if (check == 1 || check == -1)
				{
					if (SelectedKeyPoint + dist < CurveCoordCounter[s2mGridToolbar.getActiveCurve()] - KeyPointDistance)
					{
						CurveCoords[SelectedKeyPoint][POINTTYPE][s2mGridToolbar.getActiveCurve()] = NOTSET;
						CurveCoords[SelectedKeyPoint+dist][POINTTYPE][s2mGridToolbar.getActiveCurve()] = ISKEYPOINT;
						CurveCoords[SelectedKeyPoint+dist][KEYTIME][s2mGridToolbar.getActiveCurve()] = CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()];
						CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()] = NOTSET;
						SelectedKeyPoint+=dist;
					}
				}
			}
			else if (x < StartCoordX || y > StartCoordY)
			{
				dx = StartCoordX - x; dy = y - StartCoordY;
				dist = (dx > dy) ?  dx : dy;
				int check = checkKeyPointNeighbourhood(SelectedKeyPoint, dist);
				if (check == 2 || check == -1)
				{
					if (SelectedKeyPoint - dist >= 0 + KeyPointDistance)
					{
						CurveCoords[SelectedKeyPoint][POINTTYPE][s2mGridToolbar.getActiveCurve()] = NOTSET;
						CurveCoords[SelectedKeyPoint-dist][POINTTYPE][s2mGridToolbar.getActiveCurve()] = ISKEYPOINT;
						CurveCoords[SelectedKeyPoint-dist][KEYTIME][s2mGridToolbar.getActiveCurve()] = CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()];
						CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()] = NOTSET;
						SelectedKeyPoint-=dist;
					}
				}
			}
			setStartCoords(x, y);
			repaint();
			return true;
		}
		return false;
	}
	
	public void selectKeyPoint(int x, int y)
	{
		SelectedKeyPoint = NOTSET;
		SelectedKeyPoint = hitTestKeyPoint(x, y);
	}
	
	public int getSelectedKeyPoint()
	{
		return SelectedKeyPoint;
	}
	
	public boolean setKeyPointTime(int value)
	{
		if (SelectedKeyPoint >= 0 && SelectedKeyPoint < CurveCoordCounter[s2mGridToolbar.getActiveCurve()])
		{
			if (CurveCoords[SelectedKeyPoint][POINTTYPE][s2mGridToolbar.getActiveCurve()] == ISKEYPOINT)
			{
				if (value >= CurveSamplingRate)
				{
					int newglobaltime = value + calcKeyPointsTime() + CurveSamplingRate
					                  - CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()];
					if (newglobaltime > GlobalCurveTime[s2mGridToolbar.getActiveCurve()])
						setGlobalCurveTime(newglobaltime);
										
					CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()] = value;
					s2mGridToolbar.getKeyPointTimeTextField().setText(""+value);
					return true;
				}
			}
		}
		return false;
	}
	
	public int getSelectedKeyPointTime()
	{
		if (SelectedKeyPoint >= 0 && SelectedKeyPoint < CurveCoordCounter[s2mGridToolbar.getActiveCurve()])
			return CurveCoords[SelectedKeyPoint][KEYTIME][s2mGridToolbar.getActiveCurve()];
		
		return NOTSET;
	}

	//############################################################################################
	// NODE METHODS
	//############################################################################################
	public boolean addNode(int type, int x, int y)
	{
		if (type >= 0 && type < 4)
		{
			if (hitTestNode(x, y) == NOTSET)
			{
		       boolean redo = false;
		       do
		       {
			       try
			       {
						Nodes[NodeCounter][X] = x - NodeSize/2;  // store center coords
						Nodes[NodeCounter][Y] = y - NodeSize/2;
						Nodes[NodeCounter][NODECOLOR] = type;
						NodeCounter++;
					    redo = false;
			       }
			       catch(ArrayIndexOutOfBoundsException e)
			       {
			    	    resizeNodesArray(NODESRESIZEVALUE);
			    	    redo = true;
			       }
		       }while(redo == true);
			}
			repaint();	
			return true;
		}
		else
			return false;
	}

	private int hitTestNode(int x, int y)
	{
		for (int i=0; i<NodeCounter; i++)
		{				
			if ((x >= Nodes[i][X]-NodeSize/2 && x <= Nodes[i][X]+NodeSize+NodeSize/2) &&
				(y >= Nodes[i][Y]-NodeSize/2 && y <= Nodes[i][Y]+NodeSize+NodeSize/2))
			{
				return i;
			}
		}
		return -1;
	}
	
	public boolean selectNode(int x, int y)
	{
		SelectedNode = hitTestNode(x, y);
		
		if (SelectedNode != -1)
			return true;
		else
			return false;
	}
	
	public void releaseNode()
	{
		SelectedNode = -1;
		repaint();
	}
	
	public void moveNode(int x, int y)
	{		
		// check bounds
		if (SelectedNode != -1 && x >= 0 && x < getWidth()-NodeSize &&
				                   y >= 0 && y < getHeight()-NodeSize)
		{
			Nodes[SelectedNode][X] = x;
			Nodes[SelectedNode][Y] = y;
			repaint();
		}
	}
	
	public boolean removeNode(int x, int y)
	{	
		SelectedNode = hitTestNode(x, y);
		
		if (SelectedNode != -1)
		{	
			NodeCounter--;
			for (int j=SelectedNode; j<NodeCounter; j++)
			{
				Nodes[j][X] = Nodes[j+1][X];
				Nodes[j][Y] = Nodes[j+1][Y];
				Nodes[j][NODECOLOR] = Nodes[j+1][NODECOLOR];
			}
			Nodes[NodeCounter][X] = -NodeSize;
			Nodes[NodeCounter][Y] = -NodeSize;
			
			
			// check and delete node connectors
			int IndexToDelete;
			do
			{
				IndexToDelete = -1;
				for (int i=0; i<NodeConnectorCounter; i++)
				{
					if (NodeConnectors[i][FROM] == SelectedNode || 
						NodeConnectors[i][TO] == SelectedNode)
					{
						IndexToDelete = i;
						break;
					}
				}
				if (IndexToDelete != -1)
				{
					NodeConnectorCounter--;
					for (int j=IndexToDelete; j<NodeConnectorCounter; j++)
					{
						NodeConnectors[j][FROM] = NodeConnectors[j+1][FROM];
						NodeConnectors[j][TO] = NodeConnectors[j+1][TO];
					}
					NodeConnectors[NodeConnectorCounter][FROM] = NOTSET;
					NodeConnectors[NodeConnectorCounter][TO] = NOTSET;
				}
			} while (IndexToDelete != -1);
			
			repaint();
			SelectedNode = -1;
			return true;
		}
		return false;
	}

	public void movePlot(int x, int y)
	{
		lx = getWidth();
		ly = getHeight();
		hx = 0;
		hy = 0;
		
		for (int i=0; i<NodeCounter; i++)
		{
			// find border points		
			if (Nodes[i][X] < lx)
				lx = Nodes[i][X];
			if (Nodes[i][X] > hx)
				hx = Nodes[i][X];
			
			if (Nodes[i][Y] < ly)
				ly = Nodes[i][Y];
			if (Nodes[i][Y] > hy)
				hy = Nodes[i][Y];
		}
		
		if (((lx += x - StartCoordX) >= 0 && (hx += x - StartCoordX+NodeSize) < getWidth()) &&
		   ((ly += y - StartCoordY) >= 0 && (hy += y - StartCoordY+NodeSize) < getHeight()))
		{
			for (int i=0; i<NodeCounter; i++)
			{			
				Nodes[i][X] += x - StartCoordX;
				Nodes[i][Y] += y - StartCoordY;
			}
			setStartCoords(x, y);
			repaint();
		}
	}

	//#############################################################################################
	// NODE CONNECTOR METHODS
	//#############################################################################################
	public void addNodeConnector(int x, int y)
	{
		int Node = hitTestNode(x, y);
		
		if (Node != -1)
		{
			if (NodeConnectorSource)
			{
				NodeFromTemp = Node;
				NodeConnectorSource = false;
			}
			else
			{
		       boolean redo = false;
		       do
		       {
			       try
			       {
						NodeConnectors[NodeConnectorCounter][FROM] = NodeFromTemp;
						NodeConnectors[NodeConnectorCounter][TO] = Node;
						NodeConnectorCounter++;
						NodeConnectorSource = true;
					    redo = false;
			       }
			       catch(ArrayIndexOutOfBoundsException e)
			       {
			    	    resizeNodeConnectorsArray(NODECONNECTORSRESIZEVALUE);
			    	    redo = true;
			       }
		       }while(redo == true);
			}
		}
	}
}
[/code]
 

Nicole81

Aktives Mitglied
Hey ich bin Anfäner, das Ding ist halt so gewachsen, war ja schon froh, dass es so funktioniert.

Wenn ich das richtig OO Designe und Implementiere ändert das ja aber nichts an dem Speicherverbrauch bzw. würde er sogar noch größer werden.
 

Marco13

Top Contributor
Erstmal nicht direkt. Aber es hilft DIR (und ggf. jemanden, den du um hilfe bittest) den Fehler zu finden.

Vorneweg: Die ganzen großen, kommentierten Blöcke
// draw node connector
// draw the nodes
könnten (und sollten) schonmal in Methoden stehen
private void drawNodeConnector(Graphics g, ...)
private void drawNodes(Graphics g, ...)

Die Sache, die du dir da mit den Arrays ausgedacht hast
Code:
      boolean redo = false;
       do
       {
          try
          {
            CurveCoords[CurveCoordCounter[curve]][X][curve] = xend;
            CurveCoords[CurveCoordCounter[curve]][Y][curve] = yend;
            CurveCoordCounter[curve]++;
            redo = false;
          }
          catch(ArrayIndexOutOfBoundsException e)
          {
             resizeCurveCoordArray(CURVECOORDRESIZEVALUE);
             redo = true;
          }
       }while(redo == true);
ist aber GRÖBSTER Unfug - mach das anders, z.B. mit einer ArrayList, oder indem du die Größe abbfragst
Code:
if (CurveCoordCounter[curve] == array.length-1)
{
    machGrößer(array);
}
CurveCoords[CurveCoordCounter[curve]][X][curve] = xend;
CurveCoords[CurveCoordCounter[curve]][Y][curve] = yend;



Zur eigentlichen Frage: In der drawCurve wird ein neuer 3D-Array angelegt.
Code:
 private void drawCurve (Graphics g, int[][][] points, int curve, int[] pointcount, double t, int iter)
   {
      int n = pointcount[curve] - 1;

      int[][][] q = new int[n+1][n+1][2];

Lass dir vielleicht mal ausgeben, wie groß der so wird...
 

Wildcard

Top Contributor
Nicole81 hat gesagt.:
Wenn ich das richtig OO Designe und Implementiere ändert das ja aber nichts an dem Speicherverbrauch bzw. würde er sogar noch größer werden.
Das ist eine Behauptung, kein Faktum.
Es geht darum das du hier 2000 Zeilen hässlich Code hinwirfst und dann sinnvolle Hilfe erwartest.
Nimm halt einen Profiler.
Mein erster Tipp ohne mir deinen Monstercode angesehen zu haben:
Du erzeugst irgendwelche Images oder andere Objekte in paint.
Weiterhin stellt sich mir die Frage warum du nicht Swing verwendet hast.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
S JavaFX MenuItem in hoher (height größer) MenuBar vertikal zentrieren AWT, Swing, JavaFX & SWT 4
S Bilddatei kopieren, aber ohne verluste und ohne zu großen Speicherverbrauch AWT, Swing, JavaFX & SWT 17
E Frame-Speicherverbrauch AWT, Swing, JavaFX & SWT 5
G transparentes Fenster + Speicherverbrauch AWT, Swing, JavaFX & SWT 3
MartinNeuerlich Kann mir jemand, der einen Mac mit einem m1 oder m2-Chip hat, eine POM geben mit der Javafx-Fullscreen beim Mac mit m-Chip funktioniert? AWT, Swing, JavaFX & SWT 1
berserkerdq2 Wie greife ich auf ein Element zu, welches ich beim Scenebuilder erstellt habe AWT, Swing, JavaFX & SWT 10
H AWT Dialog Größe ändern - Schwarzer Inhalt beim groß ziehen AWT, Swing, JavaFX & SWT 1
L jComboBox Actionlistener wird beim erstmaligen Befüllen getriggert AWT, Swing, JavaFX & SWT 7
B Output GUI funktioniert nur beim ersten Mal richtig. AWT, Swing, JavaFX & SWT 4
A JavaFX exportierte Jar ohne beim starten die Libs hinzufügen? AWT, Swing, JavaFX & SWT 2
TheWhiteShadow JavaFX ListView Problem beim Entfernen von Elementen AWT, Swing, JavaFX & SWT 1
S Fehler beim Öffnen weiterer FXML AWT, Swing, JavaFX & SWT 11
I Probleme beim Drucken auf einen PDF-Drucker AWT, Swing, JavaFX & SWT 8
G Gui updated beim zweiten Aufruf nicht mehr AWT, Swing, JavaFX & SWT 15
K JavaFX Resizing-Problem beim BorderLayout (Center Component) beim Arbeiten mit mehreren FXMLs AWT, Swing, JavaFX & SWT 2
W Nullpointer Exception beim übertragen von Daten von Scene zu Scene AWT, Swing, JavaFX & SWT 6
missy72 JavaFX Wiederholen einer IF-Abfrage beim erneuten Öffnen einer Stage AWT, Swing, JavaFX & SWT 11
D JavaFX Probleme beim nachtäglichen hinzufügen der jfx dependency AWT, Swing, JavaFX & SWT 7
R NullPointerException beim Start des Fensters AWT, Swing, JavaFX & SWT 1
D JavaFX Label flackert beim aktualisieren AWT, Swing, JavaFX & SWT 12
J Kann mir jemand beim MediaPlayer helfen ? AWT, Swing, JavaFX & SWT 2
S JavaFx Zufallsfarbe beim Button-Klick AWT, Swing, JavaFX & SWT 22
L Swing JDialog ton beim klicken ausstellen AWT, Swing, JavaFX & SWT 1
sascha-sphw JavaFX ListCell höhe verändert sich beim ändern der Text-Farbe AWT, Swing, JavaFX & SWT 14
H Beim JFrame erstellen ein anderes schließen AWT, Swing, JavaFX & SWT 0
L Swing JLabel wird beim ändern der Schriftart immer neu gezeichnet. AWT, Swing, JavaFX & SWT 2
M AWT Kann meinen Fehler beim ActionListener nicht finden AWT, Swing, JavaFX & SWT 5
R 2D-Grafik Massive Frame Drops beim Benutzen von AffineTransformOp AWT, Swing, JavaFX & SWT 2
ruutaiokwu Swing windowStateChanged macht exakt das Gegenteil beim Verändern der Fenstergrösse AWT, Swing, JavaFX & SWT 3
J Exception beim JFrame erstellen AWT, Swing, JavaFX & SWT 6
B 2D-Grafik paintcomponent Probleme beim zeichnen AWT, Swing, JavaFX & SWT 10
D JInternalFrame wechselt Position beim ersten Click AWT, Swing, JavaFX & SWT 0
steven789hjk543 Swing Verstehe etwas beim GUI nicht AWT, Swing, JavaFX & SWT 3
L JavaFX Probleme beim Installieren JavaFX11 / JavaFX12 -- Eclipse 2019-03 AWT, Swing, JavaFX & SWT 3
H JavaFX Probleme Beim Wechseln der scene als .fxml AWT, Swing, JavaFX & SWT 7
A Fehler beim Hintergrund AWT, Swing, JavaFX & SWT 17
F JavaFX Probleme beim automatischen Konvertieren AWT, Swing, JavaFX & SWT 4
J Hilfe beim tablevies AWT, Swing, JavaFX & SWT 2
L JavaFX Fehler beim setzen von Farben AWT, Swing, JavaFX & SWT 16
T LookAndFeel LookAndFeel funktioniert nicht beim JFrame wechsel AWT, Swing, JavaFX & SWT 3
L Java FX Exception beim start AWT, Swing, JavaFX & SWT 2
L JSplitPane Divider Location beim Maximieren AWT, Swing, JavaFX & SWT 6
L JavaFX Problem beim Aufrufen einer Methode AWT, Swing, JavaFX & SWT 5
J ObservableList wirft exception beim zweiten füllen. AWT, Swing, JavaFX & SWT 4
emma_louisa JavaFX Werte beim Aufrufen des Fensters übernehmen (SceneBuilder) AWT, Swing, JavaFX & SWT 3
Tronert JavaFX Fehler beim Ändern der font-weight AWT, Swing, JavaFX & SWT 7
W Swing Hilfe beim Einbinden von Bildern in einem JFrame AWT, Swing, JavaFX & SWT 8
D Kein Icon beim JTabbedPane AWT, Swing, JavaFX & SWT 1
L JavaFX LoadException beim Laden von JavaFX Anwendung AWT, Swing, JavaFX & SWT 6
T Java FX Probleme beim befüllen eines Tableviews AWT, Swing, JavaFX & SWT 5
N Eclipse - GUI - MacBook - Buttonsichtbarkeit beim Anlegen/Erstellen AWT, Swing, JavaFX & SWT 14
S AWT Probleme beim Zeichnen AWT, Swing, JavaFX & SWT 3
T JButton wird beim vergrößern des Fensters erst sichtbar AWT, Swing, JavaFX & SWT 4
Tommy135 JavaFX JavaFX Fehler beim Scenewechsel AWT, Swing, JavaFX & SWT 23
E Swing Miserable Performance beim Ändern der Hintergrundfarbe von JLabels AWT, Swing, JavaFX & SWT 3
L Charset beim Drucken falsch AWT, Swing, JavaFX & SWT 2
MaxG. Swing Farbe von Button beim drücken ändern AWT, Swing, JavaFX & SWT 4
H JavaFX Kriege fehler beim Fenster wechseln AWT, Swing, JavaFX & SWT 7
D Swing Swing Objekte sehen im Entwurf anders aus als beim Ausführen AWT, Swing, JavaFX & SWT 3
R Swing Programm läuft nur beim Debuggen korrekt ab AWT, Swing, JavaFX & SWT 4
I 2D-Grafik Problem beim Ändern der Farbe eine 2d Objekts AWT, Swing, JavaFX & SWT 3
K Probleme beim JPasswordField AWT, Swing, JavaFX & SWT 11
W Kodierung (CharSet) beim Schreiben ändern AWT, Swing, JavaFX & SWT 1
D Swing JComboBox (DefaultComboBoxModel) überschreibt Eintrag beim erstellen AWT, Swing, JavaFX & SWT 0
T JButton überlagern sich und werden erst beim Mausscrollen sichtbar AWT, Swing, JavaFX & SWT 2
Thallius Swing "..." beim JLabel verhindern? AWT, Swing, JavaFX & SWT 3
P Scrollbalken verschwinden beim Zoomen AWT, Swing, JavaFX & SWT 4
A JavaFX DatePicker in Swing beim Start nicht sichtbar AWT, Swing, JavaFX & SWT 2
D JavaFX Probleme bei Service-Klasse beim ändern der GUI AWT, Swing, JavaFX & SWT 8
D JavaFX (WebStart) Graues Fenster beim Start AWT, Swing, JavaFX & SWT 4
K Probleme beim zeichnen mit paintComponent() AWT, Swing, JavaFX & SWT 1
O Swing JList beim Klicken in der GUI erstellen AWT, Swing, JavaFX & SWT 6
D Frame beim starten eines anderen Frames schließen AWT, Swing, JavaFX & SWT 2
R Hilfe beim ändern des Hintergrundes eines JFrames AWT, Swing, JavaFX & SWT 9
7 JavaFX Problem beim Zeichnen eines Dreiecks in einem GUI AWT, Swing, JavaFX & SWT 6
L JavaFX Verzögerung beim Laden von Daten AWT, Swing, JavaFX & SWT 6
S NullPointer Exception beim Laden von Bildern AWT, Swing, JavaFX & SWT 11
I JavaFX Speichern der eingefügten Einträge beim Neustart des Programms AWT, Swing, JavaFX & SWT 2
J JavaFx/SceneBuilder/Felder beim verlassen prüfen AWT, Swing, JavaFX & SWT 1
D JavaFX Beim Schließen (Rotes X) Code ausführen AWT, Swing, JavaFX & SWT 1
N Swing Problem beim Scrollen mit JScrollPane AWT, Swing, JavaFX & SWT 6
C Gesucht: Hilfe beim programmieren. AWT, Swing, JavaFX & SWT 1
S Action durchführen beim Programm beenden AWT, Swing, JavaFX & SWT 3
J JavaFX Tooltip Verzögerung beim ersten Anzeigen AWT, Swing, JavaFX & SWT 4
C Hilfe beim programmieren mit studiumgebundenes Projekt AWT, Swing, JavaFX & SWT 1
A JavaFX Hilfe beim Design eines Quiz AWT, Swing, JavaFX & SWT 2
H JavaFX Freezes beim Zeichnen mit Canvas AWT, Swing, JavaFX & SWT 3
D JavaFX build.fxbuild error beim Erstellen einer exe AWT, Swing, JavaFX & SWT 2
C Java FX Probleme beim Schließen einer Stage AWT, Swing, JavaFX & SWT 11
M Swing Vorgehen beim Aufruf der Klassen/Methoden AWT, Swing, JavaFX & SWT 7
T Swing NullPointerException beim auslesen von jTextField - Anfänger! AWT, Swing, JavaFX & SWT 3
R Swing Elemente verschieben sich im GBL beim Ein/Ausblenden AWT, Swing, JavaFX & SWT 0
N Swing JTree Problem beim erstellen der Knoten AWT, Swing, JavaFX & SWT 0
F Breite beim GridBagLayout festlegen AWT, Swing, JavaFX & SWT 2
N Swing CardLayout: Problem beim Wechsel zwischen den JPanels AWT, Swing, JavaFX & SWT 3
R TriangleMesh verschwindet teilweise beim resizen des Frames, sowie beim rotieren? AWT, Swing, JavaFX & SWT 1
S Swing Warum funktioniert der automatische Zeilenumbruch mit arabischen Zeichen beim JTextPane nicht AWT, Swing, JavaFX & SWT 3
T Problem beim Zeichnen von Rechteck AWT, Swing, JavaFX & SWT 3
H Swing Probleme beim erstellen eines neuen Objektes durch einen Button AWT, Swing, JavaFX & SWT 10
S Größe der Komponenten, beim ändern der größe des Frames, mit ändern! AWT, Swing, JavaFX & SWT 2

Ähnliche Java Themen

Neue Themen


Oben