本文整理匯總了Java中org.apache.pivot.collections.Dictionary類的典型用法代碼示例。如果您正苦於以下問題:Java Dictionary類的具體用法?Java Dictionary怎麽用?Java Dictionary使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Dictionary類屬於org.apache.pivot.collections包,在下文中一共展示了Dictionary類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LongSpan
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
public LongSpan(Dictionary<String, ?> span) {
if (span == null) {
throw new IllegalArgumentException("span is null.");
}
if (!span.containsKey(START_KEY)) {
throw new IllegalArgumentException(START_KEY + " is required.");
}
if (!span.containsKey(END_KEY)) {
throw new IllegalArgumentException(END_KEY + " is required.");
}
start = (Long)span.get(START_KEY);
end = (Long)span.get(END_KEY);
}
示例2: render
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
@Override
@SuppressWarnings({"unchecked"})
public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
boolean selected, boolean highlighted, boolean disabled) {
setStyles(tableView, rowIndex, selected, highlighted);
// Get the row and cell data
double percentage = 0.0;
if (row != null && columnName != null) {
Dictionary<String, Object> rowData;
if (row instanceof Dictionary<?, ?>) {
rowData = (Dictionary<String, Object>) row;
} else {
rowData = new BeanAdapter(row);
}
Object cellData = rowData.get(columnName);
if (cellData != null) {
if (cellData instanceof String) {
percentage = Double.parseDouble((String) cellData);
} else if (cellData instanceof Number) {
percentage = ((Number) cellData).doubleValue();
} else {
System.err.println("data for \"" + columnName + "\" is not a number: " + cellData);
}
}
}
meter.setPercentage(percentage);
}
示例3: processCollectionObject
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
@SuppressWarnings(value = "unchecked")
public final void processCollectionObject(Object coll) {
if (coll != null) {
if (coll instanceof java.util.List) {
process((java.util.List<T>) coll);
} else if (coll instanceof java.util.Set) {
process((java.util.Set<T>) coll);
} else if (coll instanceof org.apache.pivot.collections.Set) {
process((org.apache.pivot.collections.Set<T>) coll);
} else if (coll instanceof org.apache.pivot.collections.Sequence) {
if (coll instanceof org.apache.pivot.collections.List) {
process((org.apache.pivot.collections.List<T>) coll);
} else {
process((org.apache.pivot.collections.Sequence<T>) coll);
}
} else if (coll instanceof java.util.Map) {
process((java.util.Map<T, V>) coll);
} else if (coll instanceof org.apache.pivot.collections.Map) {
process((org.apache.pivot.collections.Map<T, V>) coll);
} else if (coll instanceof org.apache.pivot.collections.Dictionary) {
process((org.apache.pivot.collections.Dictionary<T, V>) coll);
} else if (coll instanceof java.util.Queue) {
process((java.util.Queue<T>) coll);
} else if (coll instanceof org.apache.pivot.collections.Queue) {
process((org.apache.pivot.collections.Queue<T>) coll);
} else if (coll instanceof org.apache.pivot.collections.Stack) {
process((org.apache.pivot.collections.Stack<T>) coll);
} else if (coll.getClass().isArray()) {
process((T[]) coll);
}
}
}
示例4: setFont
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
/**
* Sets the font of the text
* @param font A dictionary {@link Theme#deriveFont describing a font}
*/
public final void setFont(Dictionary<String, ?> font) {
checkNotNull(font);
setFont(Theme.deriveFont(font));
}
示例5: setMargin
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
/**
* Sets the amount of space between the edge of the TextArea and its text
* @param margin A dictionary with keys in the set {left, top, bottom, right}.
*/
public final void setMargin(Dictionary<String, ?> margin) {
checkNotNull(margin);
setMargin(new org.apache.pivot.wtk.Insets(margin));
}
示例6: process
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
@Override
public void process(Dictionary<T, V> list) {
}
示例7: SelectionAdapter
import org.apache.pivot.collections.Dictionary; //導入依賴的package包/類
public SelectionAdapter(Component eventSource, T value, String expr) {
this.eventSourceRef = new WeakReference<>(Objects.requireNonNull(eventSource));
this.data = new Dictionary.Pair<>(new Expression(expr),
new WeakReference<>(Objects.requireNonNull(value)));
}