Class Point
- All Implemented Interfaces:
Drawable,Fillable,Strokeable
-
Field Summary
Fields inherited from class schule.ngb.zm.BasicDrawable
fill, fillColor, stroke, strokeColor, strokeJoin, strokeType, strokeWeight, visibleFields inherited from class schule.ngb.zm.Constants
APP_NAME, APP_VERSION, APP_VERSION_MAJ, APP_VERSION_MIN, APP_VERSION_REV, ARROW, BEVEL, BLACK, BLUE, BOLD, BROWN, canvasHeight, canvasWidth, CENTER, CLOSED, cmouseX, cmouseY, CROSS, CYAN, DARKGRAY, DASHED, DEFAULT_ANIM_RUNTIME, DEFAULT_BACKGROUND, DEFAULT_BUFFER, DEFAULT_EASING, DEFAULT_FILLCOLOR, DEFAULT_FONTSIZE, DEFAULT_FPS, DEFAULT_HEIGHT, DEFAULT_STROKECOLOR, DEFAULT_STROKEWEIGHT, DEFAULT_WIDTH, delta, DOTTED, DOWN, DOWNLEFT, DOWNRIGHT, EAST, FILLED, framesPerSecond, GRAY, GREEN, HALF_PI, HAND, ITALIC, key, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_A, KEY_ALT, KEY_B, KEY_BACK_SPACE, KEY_C, KEY_CANCEL, KEY_CAPS_LOCK, KEY_CLEAR, KEY_COMMA, KEY_CONTROL, KEY_D, KEY_DOWN, KEY_E, KEY_END, KEY_ENTER, KEY_EQUALS, KEY_ESCAPE, KEY_F, KEY_G, KEY_H, KEY_HOME, KEY_I, KEY_J, KEY_K, KEY_L, KEY_LEFT, KEY_M, KEY_MINUS, KEY_N, KEY_O, KEY_P, KEY_PAGE_DOWN, KEY_PAGE_UP, KEY_PAUSE, KEY_PERIOD, KEY_Q, KEY_R, KEY_RIGHT, KEY_S, KEY_SEMICOLON, KEY_SHIFT, KEY_SLASH, KEY_SPACE, KEY_T, KEY_TAB, KEY_U, KEY_UP, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, keyCode, keyEvent, keyPressed, LEFT, LIGHTGRAY, LINES, LINUX, MACOS, MAGENTA, MIDDLE, MITER, MOUSE1, MOUSE2, MOUSE3, mouseButton, mouseEvent, mousePressed, mouseX, mouseY, MOVE, NOMOUSE, NORTH, NORTHEAST, NORTHWEST, OPEN, ORANGE, PI, PIE, PINK, PLAIN, pmouseX, pmouseY, PURPLE, QUARTER_PI, RED, RIGHT, ROUND, runtime, screenHeight, screenWidth, SOLID, SOUTH, SOUTHEAST, SOUTHWEST, TEXT, tick, TWO_PI, UP, UPLEFT, UPRIGHT, WAIT, WEST, WHITE, WINDOWS, YELLOW -
Constructor Summary
ConstructorsConstructorDescriptionPoint(double x, double y) Erstellt ein Punktobjekt mit den angegebenen Koordinaten.Erstellt ein Punktobjekt mit den Koordinaten des übergebenenPunktes.Erstellt ein Punktobjekt mit den Koordinaten der angegeben Form.Erstellt ein Punktobjekt mit den Koordinaten des übergebenenVektors. -
Method Summary
Modifier and TypeMethodDescriptionvoidscale(double factor) Setzt den Skalierungsfaktor auf den angegebenen Faktor.voidsetAnchor(Options.Direction anchor) Setzt den Ankerpunkt der Form auf die angegebene Richtung.Methods inherited from class schule.ngb.zm.shapes.Circle
copy, copyFrom, equals, getHeight, getRadius, getShape, getWidth, setRadius, toStringMethods inherited from class schule.ngb.zm.shapes.Shape
alignTo, alignTo, alignTo, alignTo, draw, draw, fillShape, getAbsAnchorPoint, getAnchor, getAnchorPoint, getAnchorPoint, getBounds, getRotation, getScale, getTransform, getX, getY, move, moveTo, moveTo, moveTo, moveTo, nextTo, nextTo, rotate, rotate, rotate, rotateTo, scaleBy, setGradient, setGradient, setX, setY, strokeShapeMethods inherited from class schule.ngb.zm.BasicDrawable
getFill, getFillColor, getGradient, getStroke, getStrokeColor, getStrokeJoin, getStrokeType, getStrokeWeight, hasFillColor, hasGradient, hide, isVisible, setFill, setFillColor, setStroke, setStrokeColor, setStrokeJoin, setStrokeType, setStrokeWeight, show, toggleMethods inherited from class schule.ngb.zm.Constants
abs, arccos, arcsin, arctan, asBool, asBool, asBool, asBool, asBool, asBool, asBool, asBool, asBool, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asInt, asInt, asInt, asInt, asInt, asInt, asInt, asInt, asInt, avg, binary, ceil, choice, choice, choice, choice, color, color, color, color, colorHsb, colorHsl, cos, degrees, distance, floor, fromBinary, fromHex, getRandom, hex, interpolate, limit, limit, loadImage, map, max, max, min, min, morph, noise, noise, noise, noise, pow, radians, random, random, random, random, random, randomBool, randomBool, randomBool, randomColor, randomGaussian, randomNiceColor, round, setSeed, shuffle, shuffle, shuffle, shuffle, sign, sin, sqrt, sum, tanMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface schule.ngb.zm.Fillable
hasFill, noFill, noGradient, resetFill, setFillColor, setFillColor, setFillColor, setFillColor, setFillColor, setGradient, setGradientMethods inherited from interface schule.ngb.zm.Strokeable
hasStroke, noStroke, resetStroke, setStrokeColor, setStrokeColor, setStrokeColor, setStrokeColor, setStrokeColor
-
Constructor Details
-
Point
public Point(double x, double y) Erstellt ein Punktobjekt mit den angegebenen Koordinaten.- Parameters:
x-y-
-
Point
Erstellt ein Punktobjekt mit den Koordinaten des übergebenenVektors.- Parameters:
vector-
-
Point
Erstellt ein Punktobjekt mit den Koordinaten des übergebenenPunktes.- Parameters:
point-
-
Point
Erstellt ein Punktobjekt mit den Koordinaten der angegeben Form.- Parameters:
shape-
-
-
Method Details
-
scale
public void scale(double factor) Description copied from class:ShapeSetzt den Skalierungsfaktor auf den angegebenen Faktor.Bei einem Faktor größer 0 wird die Form vergrößert, bei einem Faktor kleiner 0 verkleinert. Bei negativen Werten wird die Form entlang der x- bzw. y-Achse gespiegelt.
Das Seitenverhältnis wird immer beibehalten.
-
setAnchor
Description copied from class:ShapeSetzt den Ankerpunkt der Form auf die angegebene Richtung.Jede Form hat einen Ankerpunkt, von dem aus sie gezeichnet wird. Jede
Richtungbeschreibt einen der Neun Ankerpunkte:NW────N────NE │ │ │ │ W C E │ │ │ │ SW────S────SE
Für den Ankerpunkt
Constants.CENTERwird die Form also ausgehend von den KoordinatenShape.xundShape.yum die Hälfte der Breite nach links und rechts, sowie um die Hälfte der Höhe nach oben und unten gezeichnet. Fpr den AnkerpunktConstants.NORTHWESTdagegen um die gesamte Breite nach rechts und die Höhe nach unten.setAnchor(CENTER) │ setAnchor(NORTHWEST) ┌───────────┐ │ │ │ │ │ │ │ │ (x,y) │ │ (x,y)─────────┐ │ │ │ │ │ │ │ │ │ │ └───────────┘ │ │ │ │ │ │ │ │ │ │ └───────────┘Der Ankerpunkt der Form bestimmt bei Transformationen auch die Position des Drehzentrums und anderer relativer Koordinaten bezüglich der Form.
-