com.yworks.yfiles.server.graphml.flexio.data
Class LabelCandidateDescriptor

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.flexio.data.LabelCandidateDescriptor
All Implemented Interfaces:
ILabelCandidateDescriptor, IMarkupExtensionFactory

public class LabelCandidateDescriptor
extends java.lang.Object
implements ILabelCandidateDescriptor, IMarkupExtensionFactory

A simple mutable default implementation of the ILabelCandidateDescriptor interface.

All properties are read/write in this implementation.


Nested Class Summary
static class LabelCandidateDescriptor.ConstantDescriptor
           
 
Field Summary
static ILabelCandidateDescriptor externalDescriptor
          A sharable immutable implementation of the ILabelCandidateDescriptor interface that has penalties of 1.0 and a profit of 1.0 and yields true for the ILabelCandidateDescriptor.externalCandidate property.
static ILabelCandidateDescriptor internalDescriptor
          A sharable immutable implementation of the ILabelCandidateDescriptor interface that has penalties of 1.0 and a profit of 1.0 and yields false for the ILabelCandidateDescriptor.externalCandidate property.
 
Constructor Summary
LabelCandidateDescriptor()
          Creates a new instance of LabelCandidateDescriptor using the default values.
LabelCandidateDescriptor(boolean externalCandidate, double profit)
          Creates a new instance of LabelCandidateDescriptor.
 
Method Summary
 MarkupExtension createMarkupExtension(Lookup lookup)
          Creates a markup extension that can be used instead of the original class.
 double getProfit()
          Gets the profit to weigh in if this candidate is chosen.
 boolean isExternalCandidate()
          Gets a value indicating whether this candidate is deemed an external candidate.
 void setExternalCandidate(boolean externalCandidate)
           
 void setProfit(double profit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

externalDescriptor

public static final ILabelCandidateDescriptor externalDescriptor
A sharable immutable implementation of the ILabelCandidateDescriptor interface that has penalties of 1.0 and a profit of 1.0 and yields true for the ILabelCandidateDescriptor.externalCandidate property.


internalDescriptor

public static final ILabelCandidateDescriptor internalDescriptor
A sharable immutable implementation of the ILabelCandidateDescriptor interface that has penalties of 1.0 and a profit of 1.0 and yields false for the ILabelCandidateDescriptor.externalCandidate property.

Constructor Detail

LabelCandidateDescriptor

public LabelCandidateDescriptor()
Creates a new instance of LabelCandidateDescriptor using the default values.


LabelCandidateDescriptor

public LabelCandidateDescriptor(boolean externalCandidate,
                                double profit)
Creates a new instance of LabelCandidateDescriptor.

Parameters:
externalCandidate - Indicating whether this candidate is deemed an external candidate.
profit - The profit to weigh in if this candidate is chosen.
Method Detail

isExternalCandidate

public boolean isExternalCandidate()
Description copied from interface: ILabelCandidateDescriptor
Gets a value indicating whether this candidate is deemed an external candidate.

This is mainly for node labels, where the label may be a visual part of the node's internals, but could be used for edge labels, too, if the edge occupies significant amounts of space, visually.

Specified by:
isExternalCandidate in interface ILabelCandidateDescriptor
Returns:
A value indicating whether this candidate is deemed an external candidate.

setExternalCandidate

public void setExternalCandidate(boolean externalCandidate)

getProfit

public double getProfit()
Description copied from interface: ILabelCandidateDescriptor
Gets the profit to weigh in if this candidate is chosen.

Specified by:
getProfit in interface ILabelCandidateDescriptor
Returns:
The profit to weigh in if this candidate is chosen.

setProfit

public void setProfit(double profit)

createMarkupExtension

public MarkupExtension createMarkupExtension(Lookup lookup)
Creates a markup extension that can be used instead of the original class.

Specified by:
createMarkupExtension in interface IMarkupExtensionFactory
Parameters:
lookup - The lookup that shall be considered when creating the markup extension.


Copyright © 2000-2013 yWorks GmbH. All rights reserved