@TestClass(value="org.openscience.cdk.renderer.RendererModelTest") public class RendererModel extends Object implements Serializable, Cloneable
IRenderer
that contains settings for drawing objects.Modifier and Type | Class and Description |
---|---|
static class |
RendererModel.ColorHash
The color hash is used to color substructures.
|
static class |
RendererModel.ExternalHighlightColor
The color used to highlight external selections.
|
Constructor and Description |
---|
RendererModel()
Construct a renderer model with no parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addCDKChangeListener(ICDKChangeListener listener)
Adds a change listener to the list of listeners
|
void |
fireChange()
Notifies registered listeners of certain changes that have occurred in
this model.
|
<T extends IGeneratorParameter<S>,S> |
get(Class<T> paramType)
Returns the
IGeneratorParameter for the active IRenderer . |
IAtomContainer |
getClipboardContent()
Returns the atoms and bonds on the Renderer2D clipboard.
|
<T extends IGeneratorParameter<S>,S> |
getDefault(Class<T> param)
Returns the default value for the
IGeneratorParameter for the
active IRenderer . |
IAtomContainer |
getExternalSelectedPart()
Get externally selected atoms.
|
IAtom |
getHighlightedAtom()
Returns the atom currently highlighted.
|
IBond |
getHighlightedBond()
Returns the Bond currently highlighted.
|
Map<IAtom,IAtom> |
getMerge()
This is the central facility for handling "merges" of atoms.
|
boolean |
getNotification()
Determines if the model sends around change notifications.
|
<T extends IGeneratorParameter<?>> |
getParameter(Class<T> param)
Returns the
IGeneratorParameter for the active IRenderer . |
List<IGeneratorParameter<?>> |
getRenderingParameters()
Returns all
IGeneratorParameter s for the current
RendererModel . |
IChemObjectSelection |
getSelection()
Returns an
IChemObjectSelection with the currently selected
IChemObject s. |
String |
getToolTipText(IAtom atom)
Gets the toolTipText for atom certain atom.
|
Map<IAtom,String> |
getToolTipTextMap()
Gets the toolTipTextMap.
|
<T extends IGeneratorParameter<?>> |
hasParameter(Class<T> param)
Returns true if the passed
IGeneratorParameter s has been
registered. |
void |
registerParameters(IGenerator<? extends IChemObject> generator)
Registers rendering parameters from
IGenerator s
with this model. |
void |
removeCDKChangeListener(ICDKChangeListener listener)
Removes a change listener from the list of listeners
|
<T extends IGeneratorParameter<S>,S> |
set(Class<T> paramType,
S value)
Sets the
IGeneratorParameter for the active IRenderer . |
void |
setClipboardContent(IAtomContainer content)
Sets the atoms and bonds on the Renderer2D clipboard.
|
void |
setExternalSelectedPart(IAtomContainer externalSelectedPart)
Set externally selected atoms.
|
void |
setHighlightedAtom(IAtom highlightedAtom)
Sets the atom currently highlighted.
|
void |
setHighlightedBond(IBond highlightedBond)
Sets the Bond currently highlighted.
|
void |
setNotification(boolean notification)
Dis- or enables sending around change notifications.
|
void |
setSelection(IChemObjectSelection selection)
Set the selected
IChemObject s. |
void |
setToolTipTextMap(Map<IAtom,String> map)
Sets the toolTipTextMap.
|
public RendererModel()
@TestMethod(value="testGetRenderingParameters") public List<IGeneratorParameter<?>> getRenderingParameters()
IGeneratorParameter
s for the current
RendererModel
.IGeneratorParameter
s@TestMethod(value="testGetRenderingParameter,testReturningTheRealParamaterValue") public <T extends IGeneratorParameter<?>> T getParameter(Class<T> param)
IGeneratorParameter
for the active IRenderer
.
It returns a new instance of it was unregistered.param
- IGeneratorParameter
to get the value of.IGeneratorParameter
instance with the active value.@TestMethod(value="testGetDefaultRenderingParameter") public <T extends IGeneratorParameter<S>,S> S getDefault(Class<T> param)
IGeneratorParameter
for the
active IRenderer
.param
- IGeneratorParameter
to get the value of.IGeneratorParameter
-typed param
parameter.get(Class)
@TestMethod(value="testSetRenderingParameter") public <T extends IGeneratorParameter<S>,S> void set(Class<T> paramType, S value)
IGeneratorParameter
for the active IRenderer
.T
- paramType
- IGeneratorParameter
to set the value of.value
- new IGeneratorParameter
value@TestMethod(value="testSetRenderingParameter") public <T extends IGeneratorParameter<S>,S> S get(Class<T> paramType)
IGeneratorParameter
for the active IRenderer
.T
- paramType
- IGeneratorParameter
to get the value of.IGeneratorParameter
value.getParameter(Class)
@TestMethod(value="testGetRenderingParameter,testReturningTheRealParamaterValue") public void registerParameters(IGenerator<? extends IChemObject> generator)
IGenerator
s
with this model.generator
- @TestMethod(value="testSelection") public void setSelection(IChemObjectSelection selection)
IChemObject
s.selection
- an IChemObjectSelection
with selected
IChemObject
s@TestMethod(value="testSelection") public IChemObjectSelection getSelection()
IChemObjectSelection
with the currently selected
IChemObject
s.IChemObject
s@TestMethod(value="testMerge") public Map<IAtom,IAtom> getMerge()
@TestMethod(value="testHighlightedAtom") public IAtom getHighlightedAtom()
@TestMethod(value="testHighlightedAtom") public void setHighlightedAtom(IAtom highlightedAtom)
highlightedAtom
- The atom to be highlighted@TestMethod(value="testHighlightedBond") public IBond getHighlightedBond()
@TestMethod(value="testHighlightedBond") public void setHighlightedBond(IBond highlightedBond)
highlightedBond
- The Bond to be currently highlighted@TestMethod(value="testClipboardContent") public IAtomContainer getClipboardContent()
@TestMethod(value="testClipboardContent") public void setClipboardContent(IAtomContainer content)
content
- the new content of the clipboard.@TestMethod(value="testListening") public void addCDKChangeListener(ICDKChangeListener listener)
listener
- The listener added to the list@TestMethod(value="testListening") public void removeCDKChangeListener(ICDKChangeListener listener)
listener
- The listener removed from the list@TestMethod(value="testListening") public void fireChange()
@TestMethod(value="testToolTipFunctionality,testNoDefaultToolTips") public String getToolTipText(IAtom atom)
atom
- The atom.@TestMethod(value="testToolTipFunctionality") public void setToolTipTextMap(Map<IAtom,String> map)
map
- A map containing Atoms of the current molecule as keys and
Strings to display as values. A line break will be inserted
where a \n is in the string.@TestMethod(value="testToolTipFunctionality") public Map<IAtom,String> getToolTipTextMap()
@TestMethod(value="testExternalSelectedPart") public IAtomContainer getExternalSelectedPart()
@TestMethod(value="testExternalSelectedPart") public void setExternalSelectedPart(IAtomContainer externalSelectedPart)
externalSelectedPart
- the selected part@TestMethod(value="testGetSetNotification") public boolean getNotification()
@TestMethod(value="testHasParameter") public <T extends IGeneratorParameter<?>> boolean hasParameter(Class<T> param)
IGeneratorParameter
s has been
registered.@TestMethod(value="testGetSetNotification") public void setNotification(boolean notification)
notification
- true if notifications should be sent, false otherwise.