Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.Info
Source: src/com/multiversesocial/hyperview/Info.java, InfoDispatch.java, InfoStep.java, InfoSteps.java

Info

HyperView V3.2 — class (self running graphics demo Gadget)
version V3.2 class 36 steps

Summary

Info is a Gadget in ViewMain (button “ Info ”). Clicking it dispatches into InfoDispatch, a self running demo of the graphics classes: one step at a time, each shown for Info.STEP_MILLIS (4000 ms; change the constant or start Java with -Dinfo.step.millis=2000). Every example is built in code when its step starts. Each step runs in its own nested Dispatch frame, so when the step ends Dispatch.begin() restores the Gob, Gadget, text and line lists and the example is gone.

Skip: Next gadget or Space / Enter / Right arrow / n. Leave: Exit gadget or Escape. After the last step ViewMain is shown again exactly as it was.

Source files: Info.java (the Gadget and STEP_MILLIS), InfoDispatch.java (step sequencer, skip gadgets, keyboard), InfoStep.java (abstract step), InfoSteps.java (the steps). This page is written by test/com/multiversesocial/hyperview/InfoDoc.java from the same step table the demo runs.

Hierarchy

Extends: Gadget → Gob

Implements: none (Gadget implements HyperConstants)

Helper classes: InfoDispatch extends Dispatch (its inner classes StepFrame, Skip extend Dispatch, InfoKeys extends Gadget); InfoStep (abstract); InfoSteps implements HyperConstants.

Demo steps, in order

Which step explains which class and methods. The caption text is what the step shows on screen.

#StepCaption on screenClasses and methods explained
1Info: the graphics demo
intro
Info is a Gadget. Its Dispatch shows one graphics feature at a time and builds each example in code when the step starts. When the step ends, its display dispatch stack frame is restored and the example is gone. Esc = exit, Space = next. Buttons: Next, Exit. Info, InfoDispatch, InfoStep, InfoSteps, Gadget.addDispatch, Dispatch.begin, Dispatch.run, HyperKeyboard.focus
2DBText: text in the view
dbtext-fonts
DBText(view,string,x,y) adds a string to the view's text list (HyperView.addStr). It draws with view.curFont (index into FontBase.fonts[]) and view.fGPen (Palette pen). Set curFont/fGPen first, then create the DBText. Fonts 0..13 are Courier 8..48. DBText, DBText(HyperView,String,int,int), HyperView.addStr, HyperView.curFont, HyperView.fGPen, FontBase.fonts, FontBase.fontHeight
3DBText: pens, flags and live text
dbtext-style
view.fGPen selects the text color from the 16 named Palette pens listed on the left. TextConstants flags: THREE_D_ENA adds a shadow. Without CJAM1 the text box is filled with the background pen (textBGPen). The counter below is one DBText, edited in place. DBText.textFlags, TextConstants.THREE_D_ENA, TextConstants.CJAM1, HyperView.textStr, HyperView.textFlag, HyperView.textBGPen, Palette.color
4Palette: the color table
palette
Palette.rgb[][] holds the colors; HyperView.color[i] are the java.awt.Color objects made from it. fGPen/bGPen and the pens of text, lines and Gobs are indexes into that table. Each cell below is a DBText whose background pen (textBGPen) is the index it shows. Palette, Palette.rgb, Palette.color, HyperView.color, HyperView.bGPen, HyperView.setRGB
5FadeText: fading DBText
fadetext
FadeText extends DBText: FadeText(view,string,x,y,onTimer,repeat,flags) fades in over 11 shades of the pen color, stays onTimer milliseconds, fades out, and does that 'repeat' times before it expires (TextConstants FADE_IN, FADE_OUT, BRIGHTEN_IN, EXPIRE). FadeText, FadeText(HyperView,String,int,int,int,int,int), TextConstants.FADE_ENA, TextConstants.EXPIRE, DBText.textRestart
6Test lines
lines
HyperView.setLocation(x,y) then draw(x2,y2) adds a line to the view's line list. The pen is view.fGPen. Lines live in lineX[], lineY[], lineX2[], lineY2[], so they can be changed at any time: this star rotates by rewriting lineX2[]/lineY2[] every tick. HyperView.setLocation, HyperView.draw, HyperView.DBVectorDraw, HyperView.lineX, HyperView.lineColor, HyperView.totalLines, HyperLine, HyperView.writePixel, Pixel
7Circles
circles
Circle(view,radius,points) computes x[]/y[] on a circle (box 0..2r) and, through HyperView.addCircle, builds HyperLine segments in Circle.line[]. A Circle is only a set of lines: Info moves them to a center and calls addLine(HyperLine) to show them. Circle, Circle(HyperView,double,int), Circle.destroy, HyperView.addCircle, HyperView.addLine, HyperLine
8Gobs: graphic objects
gobs
A Gob is an image with a position: new Gob(view,imageName,w,h,x,y,flags); then view.addGob(gob). The image is loaded from the codebase URL. move(x,y) places it, enable()/disable() show or hide it (GOB_ON_DISPLAY). Five Gobs bounce here, 'duke' blinks. Gob, Gob(HyperView,String,int,int,int,int,int), HyperView.addGob, Gob.move, Gob.enable, Gob.disable, Gob.remove, HyperConstants.GOB_ON_DISPLAY
9Memory image Gobs
memory-gob
A Gob needs no image file: new Gob(view,int[] pixels,w,h,flags) wraps a java.awt.image.MemoryImageSource built from ARGB pixels computed in code (here a radial gradient with alpha). Gob.gobFlags2 GOB_MEMORYIMAGESOURCE marks them. Gob(HyperView,int[],int,int,int), Gob(HyperView,MemoryImageSource,int,int,int), java.awt.image.MemoryImageSource, Gob.isMemoryImageSource
10AnimGobs: animated sprites
animgobs
An AnimGob is a sprite: a sprite sheet strip (one image, all frames side by side) played at setFPS(). AnimGob(view,name,ext,x,y,sheetW,cellH,clips) adds itself to the Gob list. Below: the strips used by the solar system demo plus world_anim.gif, each looping. AnimGob, AnimGob(HyperView,String,String,int,int,int,int,int), AnimGob.setFPS, AnimGob.start, AnimGob.stop, AnimGob.getCurrentFrame
11AnimGob: playback controls
animgob-control
AnimGob can flip (setHorizontalFlip/setVerticalFlip), tint (setTint(color,intensity)), play a frame range (setFrameRange), ping-pong, reverse, play once (setLoop(false)) and report frames to an AnimFrameListener. Labels show the calls used on each earth. AnimGob.setHorizontalFlip, AnimGob.setVerticalFlip, AnimGob.setTint, AnimGob.setFrameRange, AnimGob.setPingPongMode, AnimGob.reverse, AnimGob.setLoop, AnimGob.setFrameListener, AnimGob.AnimFrameListener, AnimGob.getCurrentFrame, AnimGob.isPlaying
12Nested orbit AnimGobs (V3.21)
orbits
Gob.addOrbitGob(child,radius,speed,ra,dc) makes a child Gob orbit its parent, and the child can have orbit children. Sun <- Mercury, Earth, Mars. Earth <- Moon <- Rocket, nested like the Cont strips. Z order between them is sorted by HyperView.orbitTick(). Gob.addOrbitGob, Gob.z, Gob.widthBase, AnimGob, HyperView.orbitTick, HyperView.bubbleGobZ
13Spline: CURVE_LINEAR
spline-linear
Spline(view,speed,x[],y[],z[],curveType,flags): points in double, a path the Gob follows 'speed' pixels per frame ALONG the path (arc length, so constant). Exact position: Gob.fx/fy (double); x,y are rounded. CURVE_LINEAR = straight segments, grey = polygon. Spline(HyperView,double,double[],double[],double[],int,int), Spline.CURVE_LINEAR, Spline.getSpeed, Spline.getLength, Spline.getPointAtLength, Spline.step, Spline.getPathX, Gob.fx, Gob.getFloatX, Gob.setFloatPosition, Gob(HyperView,String,int,int,Spline,int), Spline.toString
14Spline: CURVE_BEZIER (a real curve)
spline-bezier
CURVE_BEZIER: one cubic Bezier per segment through the points; the handles come from the neighbouring points (setBezierHandles = your own). Before 3.2 the Gob moved on straight segments whatever the type. White = the curve (PATH_LINE_ENA). Spline.CURVE_BEZIER, Spline.setBezierHandles, Spline.getPointOnSegment, Spline.getArcLengthTable, Spline.getCurveType, Spline.PATH_LINE_ENA
15Spline: CURVE_CATMULL_ROM (a real curve)
spline-catmull-rom
CURVE_CATMULL_ROM: uniform Catmull-Rom through the points (end points duplicated). Same six points as the Bezier step: compare the two curves and the lengths printed below. The speed is constant on both: the path is sampled into an arc length table. Spline.CURVE_CATMULL_ROM, Spline.getPointOnSegment, Spline.setSamplingResolution, Spline.getCurveType, SplineConstants.PATH_LINE_ENA
16Spline.createCircle (closed)
spline-circle
Spline.createCircle(view,cx,cy,radius,points,speed[,flags]) is a CLOSED Bezier through 'points' points. Default flags WRAP_AT_END|SP_ZBUFFER_ENA (it used to have no end logic). Here flags = WRAP_AT_END: a full size Gob going round forever, seamlessly. Spline.createCircle, Spline.setClosed, Spline.flags, SplineConstants.WRAP_AT_END, SplineConstants.SP_ZBUFFER_ENA
17Spline.createEllipse (closed)
spline-ellipse
Spline.createEllipse(view,cx,cy,rx,ry,points,speed[,flags]): the same with two radii. Closed, floating point, WRAP_AT_END by default (plus the z encoding unless the flags say otherwise). The speed is the same everywhere on the ellipse, bends and straights. Spline.createEllipse, Spline.isClosed, Spline.flags
18Spline.createSpiral
spline-spiral
Spline.createSpiral(view,cx,cy,startR,endR,turns,points,speed[,flags]): an open Bezier from startR to endR. Default end logic BOUNCE_AT_END (the factory used to set none and the Gob stopped): out and back again, at constant speed through the turn. Spline.createSpiral, SplineConstants.BOUNCE_AT_END, Spline.getDirection
19Spline.createHeart (closed)
spline-heart
Spline.createHeart(view,cx,cy,size,speed[,flags]): a closed Bezier through 32 points of the heart curve, WRAP_AT_END by default. All four create...() factories return ordinary Splines: reverse(), translate(), scale(), setSpeed() still work. Spline.createHeart, SplineConstants.WRAP_AT_END, Spline.translate, Spline.scale, Spline.reverse, Spline.setSpeed
20Gob.attachSpline, detachSpline, float position
spline-attach-float
Gob.attachSpline(s): the Gob follows s (GOB_SPLINE_ENA), getSpline() returns it, detachSpline() lets go on the spot. Each frame HyperView calls Spline.step(gob): fx,fy are doubles; x,y = round(fx),round(fy). B (0.35 px/frame) shows sub pixels. Gob.attachSpline, Gob.setSpline, Gob.getSpline, Gob.detachSpline, Gob.setFloatPosition, Gob.getFloatX, Gob.getFloatY, Spline.step, Spline.advance, Spline.setSpeed, Spline.getDistance, Spline.getLength, Gob.fx, Gob.fy, HyperConstants.GOB_SPLINE_ENA
21Spline end logic: STOP_AT_END
spline-stop-at-end
STOP_AT_END (also when no END_LOGIC flag is set): the Gob is put exactly on the end point and lets go of the Spline (GOB_SPLINE_ENA off, Gob.spline null), as before 3.2. The text below shows the live Spline state until it lets go. SplineConstants.STOP_AT_END, SplineConstants.ARRIVED, Spline.advance, Spline.ADV_FINISHED, Spline.getFlagString, Gob.getSpline, Gob.detachSpline
22Spline end logic: BOUNCE_AT_END
spline-bounce-at-end
BOUNCE_AT_END: the distance folds back at the end (d = 2*length - d): the Gob turns round with no stall and no change of speed, SP_FORWARD is cleared while it goes back, and the same at the start. The overshoot of the frame is carried over (floating point). SplineConstants.BOUNCE_AT_END, SplineConstants.SP_FORWARD, Spline.advance, Spline.getDirection
23Spline end logic: COLLIDE_AT_END
spline-collide-at-end
COLLIDE_AT_END: each frame the Gobs with it are tested (CollisionManager.collide). Outline = Gob.setOutline(Polygon), default the box. Box reject, then pointInPoly(). On contact: GOB_COLLIDED, collisionCount, collidedWith and a CollisionAnimGob. SplineConstants.COLLIDE_AT_END, CollisionManager, CollisionManager.collide, CollisionManager.pointInPoly, CollisionAnimGob, Gob.setOutline, Gob.collidesAtEnd, Gob.isCollided, Gob.getCollisionCount, Gob.getCollidedWith, HyperConstants.GOB_COLLIDED
24GOB_COLLISION_OUTLINE: outline from the image
image-outline-collision
setImageOutlineEnabled(true) = flag GOB_COLLISION_OUTLINE: the first collision pass traces the outline from the image: opaque pixels, outer contour, holes ignored. C (on a Bezier Spline) dips into L's notch: boxes overlap, shapes do not. Then hits P. HyperConstants.GOB_COLLISION_OUTLINE, Gob.setImageOutlineEnabled, Gob.isImageOutlineEnabled, Gob.takesPartInCollisions, Gob.computeImageOutline, Gob.hasImageOutline, Gob.getImageOutlineRawPoints, Gob.getOutlineComputeCount, Gob.outlineComputeCount, Gob.outlineAlphaMin, Gob.outlineEpsilon, Gob.outlineMaxPoints, OutlineTracer, OutlineTracer.trace, OutlineTracer.Result, CollisionManager.collide, CollisionManager.pointInPoly, Gob.getOutline, Gob.invalidateImageOutline
25Gob.angle: rotation, outline turns too
gob-rotation
Gob.setAngleDegrees(a) / setAngle(radians): clockwise, about the Gob's centre. Angle 0 = the old drawImage path. Else nearest or bilinear, alpha is kept. The outline (orange) is traced from the alpha, turns with the Gob and scales with z. Spin = angle added per step. Yellow = the selected Gob's polygon. Gob.angle, Gob.setAngle, Gob.getAngle, Gob.setAngleDegrees, Gob.getAngleDegrees, Gob.rotateBy, Gob.setRotateInterpolation, Gob.getRotateInterpolation, Gob.ROTATE_NEAREST, Gob.ROTATE_BILINEAR, Gob.setSpin, Gob.getSpin, Gob.drawRotated, GobGeometry, GobGeometry.updateOutlineRotated, GobGeometry.worldPolygon, GobGeometry.rotate, CollisionManager.updateOutline, HyperView.selectGob, HyperView.selectColor
26Collisions: bounce, stick, hit points, explosion
gob-physics
Gob.setPhysics(mass,restitution,response): BOUNCE or STOP. Velocity vx,vy is in pixels per step. Momentum is kept; restitution 0 = they go on together. Damage = impact energy. setHitPoints(n): at 0 it explodes and is removed. STOP = 'ball in sand'. A Spline moves a Gob until its first bounce. Gob.setPhysics, Gob.setMass, Gob.getMass, Gob.setRestitution, Gob.getRestitution, Gob.setResponse, Gob.getResponse, Gob.RESPONSE_NONE, Gob.RESPONSE_BOUNCE, Gob.RESPONSE_STOP, Gob.setVelocity, Gob.getVelocityX, Gob.getVelocityY, Gob.setPhysicsMotion, Gob.resumeSpline, Gob.isPhysicsOwned, Gob.isHalted, Gob.isDynamic, Gob.vx, Gob.vy, Gob.setHitPoints, Gob.getHitPoints, Gob.getMaxHitPoints, Gob.setDamageFactor, Gob.getDamageFactor, Gob.damage, Gob.explode, Gob.onExplode, Gob.isExploded, Gob.getLastImpactEnergy, Gob.getLastImpactSpeed, Gob.getImpactCount, Gob.getLastImpactFrom, CollisionManager.respond, CollisionManager.contactNormal, CollisionManager.explode, CollisionManager.walls, CollisionManager.damageScale, CollisionManager.damageThreshold, CollisionManager.wallLeft, CollisionAnimGob
27Click to select: HyperView.pickGob
gob-pick
pickGob(x,y): the topmost Gob under a pixel (drawn last wins). Not Gadgets. A Gob with the outline flag is hit by its ALPHA: the ring's hole lets the click through to the box. Rotation and z are respected. pickOnClick: click = select. Selected = yellow outline; onSelect / onDeselect / GobPickListener report it. HyperView.pickGob, HyperView.pickGobs, HyperView.pickAndSelect, HyperView.selectGob, HyperView.getSelectedGob, HyperView.clearSelection, HyperView.pickOnClick, HyperView.selectColor, HyperView.GobPickListener, HyperView.pickListener, Gob.containsPoint, Gob.setPickable, Gob.setPickAlpha, Gob.onSelect, Gob.onDeselect, Gob.onPick, Gob.isSelected, GobGeometry.containsPoint, HyperMouse
28Spline end logic: WRAP_AT_END
spline-wrap-at-end
WRAP_AT_END: d -= length at the end, the overshoot is kept. An OPEN path (this one) jumps from the last point to the first; a CLOSED one (circle, ellipse, heart) is seamless. A straight 3 point path is used so the restart is easy to see. SplineConstants.WRAP_AT_END, Spline.advance, Spline.getDistance, Spline.reset
29Spline: SP_ZBUFFER_ENA (z depth)
spline-zbuffer
SP_ZBUFFER_ENA: the Spline has a z for every point; z runs along the same curve (double) and the Gob's width = widthBase / z uses it, so the size changes smoothly. z = 1 is full size, bigger is farther away (Gob.gobZInit, ZBUFFER_ENA). SplineConstants.SP_ZBUFFER_ENA, Gob.gobZInit, Gob.widthBase, Gob.getFloatZ, HyperConstants.ZBUFFER_ENA, Spline.ZBufferEna, Spline.ZBufferDisable
30Preferences pane
preferences
PreferencesPane (a BasicPane, which is a Gadget) holds the user's settings: GetString text fields for account, directories, host, port and the IO class names, RadioButtons, and Load/Save/Restore gadgets. Main menu 'Preferences' opens it with GetPrefs. PreferencesPane, GetPrefs, BasicPane, GetString, RadioButton, HyperView.setTitle
31Gobs and Gadgets are named by URL
url
A Gob/Gadget image name is resolved against HyperView.getCodeBase() (a URL; set with -Dcodebase=<url>): new URL(codeBase,name). An absolute URL as the name works the same. Only images (Gob, Gadget, AnimGob, background) and sounds load by URL, not the objects. HyperView.getCodeBase, HyperView.createURL, Gob.gobName, Gadget.makeBitMap, ImageGadget, AnimGob, HyperView.setBackImage, SoundClip
32Background images and the Titlebar
backimage
HyperView.setBackImage(name) loads a full view background image (640x480). setTitle(text) creates the Titlebar Gob (it shows the title, version and clock). Both are part of the backed up display: this step changes them and the previous ones return afterwards. HyperView.setBackImage, HyperView.setTitle, Titlebar, HyperView.setTitlebar, HyperView.backImageName
33Gadgets: buttons that dispatch
gadgets
A Gadget is a Gob drawn as a button: new Gadget(view," name ",x,y). addDispatch(d) attaches a Dispatch; a click makes HyperView call d.begin(). ImageGadget draws an image button. Info 'clicks' the left button itself every second (same code path). Gadget, Gadget(HyperView,String,int,int), Gadget.addDispatch, ImageGadget, Dispatch, HyperView.dispatchedGad, HyperConstants.DISPATCH_ENA
34ViewPane: a window you draw into
viewpane
ViewPane(view,x,y,w,h) is a Gadget with its own off-screen Image and java.awt.Graphics (ViewPane.graphics). drawString(), erase() and any AWT call draw into it; HyperView composites it with the other Gobs. Asteroids (the game) is a ViewPane. ViewPane, ViewPane.graphics, ViewPane.drawString, ViewPane.erase, ViewPane.setTitle, BasicPane, Gob.gobPic
35Double buffered AWT views
doublebuffer
HyperView is an AWT component (Orange extends java.awt.Component). Each frame is drawn into the off-screen screenImage (screenGraphics), then blitted to the window. USE_BLIT_OPTMIZE copies just the damaged rectangle; BUFFER_STRATEGY_ENA uses a java.awt.image.BufferStrategy. The ViewPane below is one more off-screen Image. HyperView.screenImage, HyperView.screenGraphics, HyperConstants.USE_BLIT_OPTMIZE, HyperConstants.ERASE_VIEW, HyperConstants.BUFFER_STRATEGY_ENA, HyperView.bufferStrategy, AWTEventManager, AWTViewLink, Orange, HyperView.iteration
36Display dispatch stack
dispatch-stack
Dispatch.begin() backs up the Gob, Gadget, text and line lists, the Titlebar, background and keyboard focus, runs the Dispatch, then restores them. This frame builds Gobs, goes into frame B, which builds others and goes into C. On return the lists are compared. Dispatch.begin, Dispatch.run, Dispatch.cleanUp, HyperConstants.INHERIT_GADGETS, HyperConstants.INHERIT_LINES, HyperView.runView, HyperView.gob, HyperView.gads, HyperView.textStr, HyperView.lineX, HyperView.runStack

Class coverage

Each class named by a step and the steps (see the table above) that explain it.

ClassSteps
AWTEventManager35
AWTViewLink35
AnimGob10, 11, 12, 31
BasicPane30, 34
Circle7
CollisionAnimGob23, 26
CollisionManager23, 24, 25, 26
DBText2, 3, 5
Dispatch1, 33, 36
FadeText5
FontBase2
Gadget1, 31, 33
GetPrefs30
GetString30
Gob8, 9, 12, 13, 20, 21, 23, 24, 25, 26, 27, 29, 31, 34
GobGeometry25, 27
HyperConstants8, 20, 23, 24, 29, 33, 35, 36
HyperKeyboard1
HyperLine6, 7
HyperMouse27
HyperView2, 3, 4, 6, 7, 8, 12, 25, 27, 30, 31, 32, 33, 35, 36
ImageGadget31, 33
Info1
InfoDispatch1
InfoStep1
InfoSteps1
Orange35
OutlineTracer24
Palette3, 4
Pixel6
PreferencesPane30
RadioButton30
SoundClip31
Spline13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 28, 29
SplineConstants15, 16, 18, 19, 21, 22, 23, 28, 29
TextConstants3, 5
Titlebar32
ViewPane34

Graphics classes not demonstrated

Classes the demo has no step for, and why. Each has its own page.

ClassReason
AnimationConstantsinterface of two flag constants (ANIM_LOADED, COLLISION_ENA); no step needs them
BitmapConstantsinterface with one flag constant (MEMORYIMAGE_ENA)
LineConstantsflag constants of HyperLine (VECTOR_ENA is tested by the renderer but its movement is a Todo)
FontBaseButtona button that opens FontPane; needs interaction
FontPanefont chooser pane; needs interaction
Image2RGBtool Dispatch with its own gadget in ViewMain (Image2RGB); reads an image into pixel data
MemoryImageButtona Gadget showing a memory image; the Memory image Gobs step shows the Gob itself
MemoryImageGobDispatchViewMain's own MemoryImage Gob() gadget; Info builds its own
MemoryImageGobPanepane used by MemoryImageGobDispatch
Scanlinepixel collision mask of a Gob (GOB_COLLISION_ENA, Gob.initScanline, Gob.collisionOn); no step shows it. The collision steps use outline polygons instead (hand set or traced from the image by OutlineTracer), not this mask
SplineEditDispatchinteractive Spline editor (ViewMain gadget SplineEdit); needs the mouse
SplineEditPanepane of the Spline editor; needs the mouse
SuperBitmapbitmap Gadget base of the console; no step
SuperBitmapConsoleconsole bitmap; ViewMain's NCLI TextPane is the example
TextPanescrolling text console (ViewMain's NCLI pane); no step
StateDispatchstate machine dispatch; networking, not graphics
AudioClipsound; there is no audio output on the machine the demo was tested on
HyperScrollbarscroll bar Gadget; no step

Behavior notes (what the code really does)

Declaration & members

public class Info extends Gadget

Fields (1)

SignatureDescription
static final int STEP_MILLISTime each step is shown, in milliseconds. Default 4000; -Dinfo.step.millis=N overrides it.

Constructors (1)

SignatureDescription
Info(HyperView tView, int tX, int tY)Makes the “ Info ” Gadget at tX,tY, adds an InfoDispatch and shows it (GOB_ON_DISPLAY). ViewMain.main() creates one at 201,116.

InfoDispatch (constants used by steps)

MemberDescription
SLICE_MILLISrunView() slice and tick rate of a step (100 ms).
DEMO_TOP, DEMO_BOTTOMPixel rows free for the example (112 to 440).
text(), setText(), gob(), line()Helpers: add a DBText (returns its slot in the view text list), change it in place, add a Gob, add a line.
stepNum, errors, stepsRun, finishedStatic state read by the test (InfoRunTest).

Running and testing

Compile with compile27 or this single plain line (javac on the PATH, no environment variables) : javac -encoding US-ASCII -d build/classes -cp lib/comm.jar -sourcepath src src/com/multiversesocial/hyperview/*.java. Run ViewMain and click “ Info ”. The test test/com/multiversesocial/hyperview/InfoRunTest.java starts ViewMain, clicks Info, saves a screenshot of every step, checks no step threw, the dispatch stack step reports all lists restored, and that Next, Space and Escape work (run it on a display, for example under Xvfb). It also checks the spline steps (the three curve types have three different lengths, the STOP step lets go of the Spline), the attach/detach step (sub pixel fx while x is an int), the COLLIDE_AT_END step (the Gobs get flagged, collide, the impact animation is drawn) and the image outline step (3 traces for the 3 flagged Gobs, none for the Gob without the flag; the circle's box overlaps the L's box without a collision, then it hits the plus sign). test/com/multiversesocial/hyperview/CollisionTest.java tests CollisionManager.pointInPoly and the collision pass itself (flags, counters, the CollisionAnimGob, no spurious or recursive collisions, nested Dispatch frames). SplineTest.java tests the curve math (Bezier and Catmull-Rom at known t, arc length, constant speed, the four end modes with fractional speeds), attach/detach and the movement in the real display loop. OutlineTest.java tests OutlineTracer on known shapes, the flag gating (the compute counter), and collisions between outlined Gobs whose boxes overlap but whose shapes do not.

Hits--