本文整理汇总了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)));
}