|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bioinfweb.treegraph.document.ContrastManager
public class ContrastManager
Ensures that document elements (that are e.g. pasted from the clipboard) have a sufficient contrast to the document background.
Nested Class Summary | |
---|---|
(package private) static class |
ContrastManager.State
|
Field Summary | |
---|---|
private ContrastManager.State |
state
|
Constructor Summary | |
---|---|
ContrastManager()
|
Method Summary | |
---|---|
private boolean |
checkColor(Color foreground,
Color background)
Checks if two colors have an unsifficient contast. |
private boolean |
confirmChange()
Asks the user whether to change any colors if this was not already done. |
boolean |
ensureContrast(Document document,
Label label)
Checks the text color of the specified label regarding to its contrast to the background color of the document. |
boolean |
ensureContrast(Document document,
Label[] labels)
Checks the text color of the specified labels regarding to their contrast to the background color of the document. |
boolean |
ensureContrast(Document document,
Legend legend)
Checks the text color of the specified legend regarding to its contrast to the background color of the document. |
boolean |
ensureContrast(Document document,
Node root,
Legend[] legends)
Checks the colors of all elements in the subtree under root (including
root and its afferent branch) regarding to their contrast to the
background color of the document. |
private boolean |
ensureLabelBlock(Labels labels,
boolean above,
Color bgColor,
Color defaultColor)
|
private boolean |
ensureLabelContrast(Document document,
Label label)
Internal method which does not set state = State.UNDEFINED . |
private boolean |
ensureLegendContrast(Document document,
Legend legend)
|
private boolean |
ensureSubtreeContrast(Document document,
Node root)
Rekursive method which contains the actual implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ContrastManager.State state
Constructor Detail |
---|
public ContrastManager()
Method Detail |
---|
private boolean confirmChange()
false
if the user aborted the operation during the call of this
methodprivate boolean checkColor(Color foreground, Color background)
foreground
- background
-
false
if the user aborted the operation during the call of this
methodprivate boolean ensureLabelBlock(Labels labels, boolean above, Color bgColor, Color defaultColor)
private boolean ensureSubtreeContrast(Document document, Node root)
document
- the document where the subtree shall be inserted toroot
- the root node of the subtree
false
if the user aborted the operation during the call of this
methodprivate boolean ensureLegendContrast(Document document, Legend legend)
public boolean ensureContrast(Document document, Node root, Legend[] legends)
root
(including
root
and its afferent branch) regarding to their contrast to the
background color of the document.
document
- the document where the subtree shall be inserted toroot
- the root node of the subtreedefaultColor
- the color which shall be set to elements with an unsufficient contrast
false
if the subtree shall not be pastedprivate boolean ensureLabelContrast(Document document, Label label)
state = State.UNDEFINED
.
document
- the document where the label shall be inserted tolabel
-
false
if the user aborted the operation during the call of this
methodpublic boolean ensureContrast(Document document, Label label)
document
- the document where the subtree shall be inserted tolabel
- the label to be inserteddefaultColor
- the color which shall be set to elements with an unsufficient contrast
false
if the label shall not be pastedpublic boolean ensureContrast(Document document, Label[] labels)
document
- the document where the subtree shall be inserted tolabels
- the labels to be inserted
false
if the labels shall not be pastedpublic boolean ensureContrast(Document document, Legend legend)
document
- the document where the subtree shall be inserted tolegend
- the legend to be inserted
false
if the legend shall not be pasted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |