Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.Gadget
Source: src/com/multiversesocial/hyperview/Gadget.java

Gadget

HyperView V3.2 — class
version V3.2 class

Summary

A Gadget is a Gob(), but can have a Dispatch() Object attached. todo move all initialization to init

Source file: Gadget.java

Hierarchy

Extends: Gob

Implements: HyperConstants

Referenced HyperView classes

Media files used

Declaration & members

public class Gadget extends Gob implements HyperConstants

Declared in src/com/multiversesocial/hyperview/Gadget.java, lines 12–755. 35 field(s), 13 constructor(s), 26 method(s). Every member has an anchor you can link to (e.g. Gadget.html#<id>).

Fields (35)

DeclarationValue / initializerDescriptionSource
Color backColorNo comment in source; assigned in cleanUp(); used in toString().line 43
Font conFontNo comment in source; assigned in Gadget(), cleanUp(); used in makeBitmap(), toString().line 32
Graphics cursorGraphicsNo comment in source; assigned in cleanUp(); used in toString().line 26
int cursorHeightNo comment in source; assigned in Gadget(); used in drawCursor().line 24
Image cursorImageNo comment in source; assigned in cleanUp(); used in toString().line 25
String cursorNameNo comment in source; assigned in Gadget(), cleanUp(); used in toString().line 23
int cursorScrollXOffsetNo comment in source; assigned in Gadget(); used in toString().line 28
int cursorScrollYOffsetNo comment in source; assigned in Gadget().line 29
int cursorWidthNo comment in source; assigned in Gadget(); used in drawCursor(), toString().line 24
int cursorXNo comment in source; assigned in Gadget(); used in drawCursor(), toString().line 27
int cursorYNo comment in source; assigned in Gadget(); used in drawCursor(), toString().line 27
volatile int displayInfoNo comment in source; assigned in Gadget(); used in toString().line 18
Color fGColorNo comment in source; assigned in Gadget(), cleanUp(); used in toString().line 33
byte flipCountNo comment in source; assigned in Gadget(); used in toString().line 21
int fontNo comment in source; assigned in Gadget(), makeBitmap(); used in toString().line 15
volatile int gadFlagsNo comment in source; assigned in Gadget(), setEnabled(), addDispatch(), onMouseOver(), keyReleaseENA() …; used in isEnabled(), drawCursor(), makeBitmap(), toString().line 16
volatile int gadFlags2No comment in source; assigned in Gadget(); used in toString().line 17
int gadNumberNo comment in source; assigned in Gadget(); used in toString().line 22
HyperKeyboard keyboard= nullNo comment in source; assigned in Gadget(), cleanUp().line 48
int lastCursorXNo comment in source; assigned in Gadget(); used in toString().line 30
int lastCursorYNo comment in source; assigned in Gadget(); used in toString().line 31
Color lineColorA3 colors Bright, Medium , darkline 44
Color lineColorBActive GetString gets A,B otherwise B,Cline 45
Color lineColorCNo comment in source; assigned in drawOutline(), drawOutline2(), cleanUp(); used in toString().line 46
boolean lockedNo comment in source; assigned in Gadget().line 19
Dispatch methodNo comment in source; assigned in addDispatch(); used in Gadget(), toString().line 20
Titlebar parentTitlebarNo comment in source; assigned in Gadget(), cleanUp().line 14
int stringHeightNo comment in source; assigned in Gadget(), makeBitmap(); used in toString().line 37
int stringWidthNo comment in source; assigned in Gadget(), makeBitmap(); used in toString().line 36
int stringXNo comment in source; assigned in Gadget(), makeBitmap(); used in setName(), toString().line 34
int stringYNo comment in source; assigned in Gadget(), makeBitmap(); used in setName(), toString().line 35
Color tc1scratch color referencesline 39
Color tc2No comment in source; assigned in makeBitmap(), cleanUp().line 40
Color tc3No comment in source; assigned in makeBitmap(), cleanUp().line 41
Color tc4No comment in source; assigned in makeBitmap(), cleanUp().line 42

Constructors (13)

SignatureDescriptionSource
public Gadget()24 statement(s); calls super(); creates Color.line 50
public Gadget(String tName)1 statement(s); calls this().line 77
public Gadget(HyperView tView, String tName)1 statement(s); calls this().line 82
public Gadget(String tName, int pX, int pY)1 statement(s); calls this(), HyperView.getCurView().line 87
public Gadget(String tName, int pX, int pY, Font tmpFont)1 statement(s); calls this(), HyperView.getCurView().line 93
public Gadget(HyperView tView, String tString, int pX, int pY, int tWidth, int tHeight)1 statement(s); calls this().line 98
public Gadget(String tString, int pX, int pY, int tWidth, int tHeight)1 statement(s); calls this(), HyperView.getCurView().line 103
public Gadget(Dispatch tDispatch, String tName, int pX, int pY)1 statement(s); calls this().line 108
public Gadget(HyperView tView, String tName, int pX, int pY)1 statement(s); calls this().line 113
public Gadget(HyperView tView, String tName, int pX, int pY, Font tmpFont)1 statement(s); calls this().line 118
public Gadget(HyperView tView, String tName, int pX, int pY, int tWidth, int tHeight, Font tmpFont)1 statement(s); calls this().line 123
public Gadget(HyperView tView, String tName, int pX, int pY, int tWidth, int tHeight, int tGobFlags, int tGadFlags, Font tmpFont)1 statement(s); calls this().line 129
public Gadget(HyperView tView, String tName, Titlebar tTilebar, int pX, int pY, int tWidth, int tHeight, int tGobFlags, int tGadFlags, Font tmpFont)51 statement(s); calls super(), HyperView.getCurView(), System.exit(), addDispatch(), makeBitmap() …; creates Color, Dispatch.line 135

Methods (26)

SignatureDescriptionSource
public void addDispatch(Dispatch d)2 statement(s).line 259
public void allKeyMsgENA()1 statement(s).line 297
public void cleanUp()16 statement(s); calls super.cleanUp(), cursorImage.flush(), cursorGraphics.dispose().
Overrides Gob.cleanUp()
line 727
public void drawCursor()4 statement(s); calls graphics.setColor(), graphics.fillRect(), Math.max().line 341
public void drawOutline()8 statement(s); calls lineColorA.darker(), lineColorB.darker(), graphics.setColor(), graphics.drawLine().line 302
public void drawOutline2()8 statement(s); calls lineColorA.darker(), lineColorB.darker(), graphics.setColor(), graphics.drawLine().line 321
public Color getForeground()Returns curView.color[fGPen].line 249
public void inKey()1 statement(s); calls curView.hyperViewOut().line 272
public void inString(String str)1 statement(s); calls curView.hyperViewOut().line 280
public boolean isEnabled()1 statement(s).line 233
public boolean isShowing()1 statement(s).line 212
public boolean isVisible()Returns this.isShowing().line 220
public void keyReleaseENA()1 statement(s).line 287
public void keyTypedENA()1 statement(s).line 292
public void layerDisable()1 statement(s).line 523
public void layerENA()1 statement(s).line 518
public void makeBitmap(Font tmpFont)25 statement(s); calls curView.screenGraphics.getFontMetrics(), fm.stringWidth(), fm.getHeight(), curView.createImage(), gobPic.getGraphics() …; creates URL.line 374
public void mouseWheelMoved(MouseWheelEvent e)1 statement(s); calls e.getWheelRotation().line 528
public void onMouseOver()stubs to keep javac happyline 265
public void setEnabled(boolean b)1 statement(s).line 241
public void setForeground(int c)Sets this.fGPen = c.line 254
public void setName(String tStr)7 statement(s); calls graphics.setColor(), graphics.fillRect(), graphics.drawString().
Overrides Linkable.setName()
line 363
public void setVisible(boolean b)1 statement(s).line 225
public void toFront()1 statement(s); calls curView.gadgetToFront(), curView.blitterLock.notifyAll().line 535
public String toString()86 statement(s); calls sb.append(), method.toString(), cursorImage.toString(), cursorGraphics.toString(), conFont.toString() …; creates StringBuilder.
Overrides Gob.toString()
line 544
public void updateText()1 statement(s); calls curView.statusText().line 355

Inherited members

Non-private members inherited from HyperView superclasses and not overridden or hidden here.

From Gob (76 fields, 27 methods)

Fields: asynchGraphics1, asynchGraphics2, asynchImage1, asynchImage2, attachedGob, attachedIndex, backGround, bgMemoryImageSource, bGPen, bottomMax, clickX, clickY, collisionClassMask, curAttached, currentZIndex, curView, depth, destGob, destGraphics, dispatchHoldCount, drawMode, dX, dY, dZ, fgMemoryImageSource, fGPen, gobEventFlags, gobFlags, gobFlags2, gobGadIndex, gobHx, gobHy, gobHz, gobName, gobNumber, gobOrbitRadius, gobPic, gobTypeFlags, graphics, gravity, height, heightBase, hSin, hyp, infoString, lClickX, lClickY, leftMin, maxAttached, memoryCounter, moveNum, mX, mX2, mY, mY2, oldX, oldY, oldZ, orbitGob, rightMax, scanLine, selectGraphics, selectImage, selectTime, spline, tint, topMin, totalAttached, width, widthBase, wSin, x, x2, y, y2, z

Methods: addGob(Gob), addSpline(Spline), center(), collisionOff(), collisionOn(), disable(), enable(), getGraphics(), getImageFromJar(String), getPixels(), gobZInit(), initScanline(int), inView(), isInView(), isMemoryImageSource(), move(int, int), move(Gadget, int, int), moveNext(), onClick(), onDisplay(), onRelease(), printGobAttr(HyperView), printScanLines(), remGob(), remove(), zENA(), zOff()

From Linkable (7 fields, 1 methods)

Fields: attachment, index, linkFlags, name, next, parentList, prev

Methods: inList()

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

instantiation — ChannelControlPane.java, line 90

   89                    //
   90  newChannelGadget   = new Gadget(" New   ",438,29);

subclass — BasicPane.java, line 5

    5  public class BasicPane extends Gadget
    6  {

declaration — ColorPop.java, line 12

   12  Gadget okGadget;

Applet hosting

Supplies the input hooks a ported applet’s pane overrides: inKey(), onMouseOver(), mouseWheelMoved(), plus onClick()/onRelease() from Gob and addDispatch(). See the Applet Migration Guide.

Hits--