Package com.j3d.gen.grid
Class ReactivePoint
java.lang.Object
com.j3d.gen.grid.Point
com.j3d.gen.grid.ReactivePoint
- All Implemented Interfaces:
EventEmitterInterface,EventListener,GridObject<GPoint>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ArrayList<EventListener> (package private) GPoint(package private) boolean(package private) Function<CartesianPoint, CartesianPoint> -
Constructor Summary
ConstructorsConstructorDescriptionReactivePoint(GPoint gPoint, Supplier<AxisPlane> axisPlaneSupplier, Function<CartesianPoint, CartesianPoint> pointRounder) -
Method Summary
Modifier and TypeMethodDescriptionvoidattachListener(EventListener event) Registers an event listener into the list of listeners.<K> voidbroadcast(EventType eventType, EventPayload<K> properties) Calls all events with the given event type and broadcast propertiesvoidDeregisters all event listeners.voiddetachListener(EventListener event) Deregisters an event listener.voiddraw(Graphics2D graphics2D, ConversionWithOffset props) voiddrawWorld(Graphics2D graphics2D, AxisPlane axisPlane) getPoint(ConversionWithOffset props) booleanChecks if the given event listener is attached to this event emitter.<K> voidonEvent(EventType event, EventPayload<K> properties) onEvent is called byEventEmitterviaEventEmitter.broadcast(EventType, EventPayload).
-
Field Details
-
gp
GPoint gp -
axisPlaneSuppler
-
pointRounder
Function<CartesianPoint,CartesianPoint> pointRounder -
events
ArrayList<EventListener> events -
invalid
boolean invalid
-
-
Constructor Details
-
ReactivePoint
public ReactivePoint(GPoint gPoint, Supplier<AxisPlane> axisPlaneSupplier, Function<CartesianPoint, CartesianPoint> pointRounder)
-
-
Method Details
-
getPoint
-
draw
- Specified by:
drawin interfaceGridObject<GPoint>- Overrides:
drawin classPoint
-
drawWorld
- Specified by:
drawWorldin interfaceGridObject<GPoint>- Overrides:
drawWorldin classPoint
-
render
- Specified by:
renderin interfaceGridObject<GPoint>- Overrides:
renderin classPoint
-
onEvent
Description copied from interface:EventListeneronEvent is called byEventEmitterviaEventEmitter.broadcast(EventType, EventPayload). Allowing the emitter to call any other object that implements this.- Specified by:
onEventin interfaceEventListener- Type Parameters:
K- The type of the emitter of this event- Parameters:
event- The type of eventproperties- The given event payload
-
attachListener
Description copied from interface:EventEmitterInterfaceRegisters an event listener into the list of listeners.- Specified by:
attachListenerin interfaceEventEmitterInterface- Parameters:
event- The listener to attach
-
detachListener
Description copied from interface:EventEmitterInterfaceDeregisters an event listener.- Specified by:
detachListenerin interfaceEventEmitterInterface- Parameters:
event- The listener to detach.
-
detachAll
public void detachAll()Description copied from interface:EventEmitterInterfaceDeregisters all event listeners.- Specified by:
detachAllin interfaceEventEmitterInterface
-
broadcast
Description copied from interface:EventEmitterInterfaceCalls all events with the given event type and broadcast properties- Specified by:
broadcastin interfaceEventEmitterInterface- Parameters:
eventType- The event type.properties- Properties to pass onto the listener.
-
isAttached
Description copied from interface:EventEmitterInterfaceChecks if the given event listener is attached to this event emitter.- Specified by:
isAttachedin interfaceEventEmitterInterface- Parameters:
e- The event listener to check.- Returns:
- True if the event listener is attached, false otherwise.
-
getGPoint
-