public class SyncCoordinatesAspect
extends java.lang.Object
com.goldencode.p2j.ui.*Config
classes. Also all assignments
of coordinate values to the config coordinate fields are scaled
through Coordinate.scale(double)
.
The aspect intercepts both server and client.
During char->pixel conversion the converted value must be rounded to the nearest pixel. This also means that the original character value doesn't correspond to its pixel representation. This is why another conversion from pixel to char is performed and the original character value set to the config field may change!
Modifier and Type | Class and Description |
---|---|
private class |
SyncCoordinatesAspect.WorkArea
Class for cached values saved in the context.
|
Modifier and Type | Field and Description |
---|---|
private ContextLocal<SyncCoordinatesAspect.WorkArea> |
contextData
Storage of context-local state variables.
|
private static java.lang.ThreadLocal<java.lang.Integer> |
suspendCount
Thread local variable holding the number of suspensions.
|
Constructor and Description |
---|
SyncCoordinatesAspect() |
Modifier and Type | Method and Description |
---|---|
void |
afterSetClientColumn(BaseConfig cfg)
The after-advice for
BaseConfig.clientColumn . |
void |
afterSetClientHeightChars(BaseConfig cfg)
The after-advice for HEIGHT-CHARS attribute.
|
void |
afterSetClientHeightPixels(BaseConfig cfg)
The after-advice for HEIGHT-PIXELS attribute.
|
void |
afterSetClientRow(BaseConfig cfg)
The after-advice for
BaseConfig.clientRow . |
void |
afterSetClientWidthChars(BaseConfig cfg)
The after-advice for WIDTH-CHARS attribute.
|
void |
afterSetClientWidthPixels(BaseConfig cfg)
The after-advice for WIDTH-PIXELS attribute.
|
void |
afterSetClientX(BaseConfig cfg)
The after-advice for
BaseConfig.clientX . |
void |
afterSetClientY(BaseConfig cfg)
The after-advice for
BaseConfig.clientY . |
void |
afterSetColumn(BaseConfig cfg)
The after-advice for
BaseConfig.column . |
void |
afterSetFullHeightChars(WindowConfig cfg)
The after-advice for FULL-HEIGHT-CHARS attribute.
|
void |
afterSetFullHeightPixels(WindowConfig cfg)
The after-advice for FULL-HEIGHT-PIXELS attribute.
|
void |
afterSetFullWidthChars(WindowConfig cfg)
The after-advice for FULL-WIDTH-CHARS attribute.
|
void |
afterSetFullWidthPixels(WindowConfig cfg)
The after-advice for FULL-WIDTH-PIXELS attribute.
|
void |
afterSetHeightChars(BaseConfig cfg)
The after-advice for HEIGHT-CHARS attribute.
|
void |
afterSetHeightPixels(BaseConfig cfg)
The after-advice for HEIGHT-PIXELS attribute.
|
void |
afterSetInitColumn(BaseConfig cfg)
The after-advice for
BaseConfig.initColumn . |
void |
afterSetInitRow(BaseConfig cfg)
The after-advice for
BaseConfig.initRow . |
void |
afterSetInitX(BaseConfig cfg)
The after-advice for
BaseConfig.initX . |
void |
afterSetInitY(BaseConfig cfg)
The after-advice for
BaseConfig.initY . |
void |
afterSetMaxHeightChars(WindowConfig cfg)
The after-advice for MAX-HEIGHT-CHARS attribute.
|
void |
afterSetMaxHeightPixels(WindowConfig cfg)
The after-advice for MAX-HEIGHT-PIXELS attribute.
|
void |
afterSetMaxWidthChars(WindowConfig cfg)
The after-advice for MAX-WIDTH-CHARS attribute.
|
void |
afterSetMaxWidthPixels(WindowConfig cfg)
The after-advice for MAX-WIDTH-PIXELS attribute.
|
void |
afterSetMinHeightChars(WindowConfig cfg)
The after-advice for MIN-HEIGHT-CHARS attribute.
|
void |
afterSetMinHeightPixels(WindowConfig cfg)
The after-advice for MIN-HEIGHT-PIXELS attribute.
|
void |
afterSetMinWidthChars(WindowConfig cfg)
The after-advice for MIN-WIDTH-CHARS attribute.
|
void |
afterSetMinWidthPixels(WindowConfig cfg)
The after-advice for MIN-WIDTH-PIXELS attribute.
|
void |
afterSetRow(BaseConfig cfg)
The after-advice for
BaseConfig.row . |
void |
afterSetVirtHeightChars(PaneConfig cfg)
The after-advice for VIRTUAL-HEIGHT-CHARS attribute.
|
void |
afterSetVirtHeightPixels(PaneConfig cfg)
The after-advice for VIRTUAL-HEIGHT-PIXELS attribute.
|
void |
afterSetVirtWidthChars(PaneConfig cfg)
The after-advice for VIRTUAL-WIDTH-CHARS attribute.
|
void |
afterSetVirtWidthPixels(PaneConfig cfg)
The after-advice for VIRTUAL-WIDTH-PIXELS attribute.
|
void |
afterSetWidthChars(BaseConfig cfg)
The after-advice for WIDTH-CHARS attribute.
|
void |
afterSetWidthPixels(BaseConfig cfg)
The after-advice for WIDTH-PIXELS attribute.
|
void |
afterSetX(BaseConfig cfg)
The after-advice for
BaseConfig.x . |
void |
afterSetY(BaseConfig cfg)
The after-advice for
BaseConfig.y . |
static boolean |
isSuspended()
Returns
true when coordinate synchronization has been
suspended with suspend() . |
static void |
resume()
Resumes coordinate synchronization previously suspended with
resume() . |
static void |
suspend()
Suspends coordinate synchronization for the current thread.
|
java.lang.Object |
suspendAround(org.aspectj.lang.ProceedingJoinPoint jp)
This advice is executed for methods annotated with
NoSyncCoordinates . |
void |
withinCommonPoint()
The common pointcut for all the advices.
|
private ContextLocal<SyncCoordinatesAspect.WorkArea> contextData
private static java.lang.ThreadLocal<java.lang.Integer> suspendCount
public void withinCommonPoint()
NoSyncCoordinates
annotation.public static void suspend()
resume()
.public static void resume()
resume()
.public static boolean isSuspended()
true
when coordinate synchronization has been
suspended with suspend()
.public java.lang.Object suspendAround(org.aspectj.lang.ProceedingJoinPoint jp)
NoSyncCoordinates
.
It suspends coordinate synchronization with suspend()
before
the annotated method is executed and then resumes with resume()
after the annotated method returns.jp
- A reference to ProceedingJoinPoint
.public void afterSetInitColumn(BaseConfig cfg)
BaseConfig.initColumn
.cfg
- The target config reference being intercepted.public void afterSetInitRow(BaseConfig cfg)
BaseConfig.initRow
.cfg
- The target config reference being intercepted.public void afterSetInitX(BaseConfig cfg)
BaseConfig.initX
.cfg
- The target config reference being intercepted.public void afterSetInitY(BaseConfig cfg)
BaseConfig.initY
.cfg
- The target config reference being intercepted.public void afterSetColumn(BaseConfig cfg)
BaseConfig.column
.cfg
- The target config reference being intercepted.public void afterSetRow(BaseConfig cfg)
BaseConfig.row
.cfg
- The target config reference being intercepted.public void afterSetX(BaseConfig cfg)
BaseConfig.x
.cfg
- The target config reference being intercepted.public void afterSetY(BaseConfig cfg)
BaseConfig.y
.cfg
- The target config reference being intercepted.public void afterSetClientColumn(BaseConfig cfg)
BaseConfig.clientColumn
.cfg
- The target config reference being intercepted.public void afterSetClientRow(BaseConfig cfg)
BaseConfig.clientRow
.cfg
- The target config reference being intercepted.public void afterSetClientX(BaseConfig cfg)
BaseConfig.clientX
.cfg
- The target config reference being intercepted.public void afterSetClientY(BaseConfig cfg)
BaseConfig.clientY
.cfg
- The target config reference being intercepted.public void afterSetWidthChars(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetHeightChars(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetWidthPixels(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetHeightPixels(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetClientWidthChars(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetClientHeightChars(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetClientWidthPixels(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetClientHeightPixels(BaseConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMinWidthChars(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMinHeightChars(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMinWidthPixels(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMinHeightPixels(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMaxWidthChars(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMaxHeightChars(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMaxWidthPixels(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetMaxHeightPixels(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetFullWidthChars(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetFullHeightChars(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetFullWidthPixels(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetFullHeightPixels(WindowConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetVirtWidthChars(PaneConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetVirtHeightChars(PaneConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetVirtWidthPixels(PaneConfig cfg)
cfg
- The target config reference being intercepted.public void afterSetVirtHeightPixels(PaneConfig cfg)
cfg
- The target config reference being intercepted.