当前位置: 首页>>代码示例>>Java>>正文


Java Dictionary类代码示例

本文整理汇总了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);
}
 
开发者ID:bramp,项目名称:dissector,代码行数:17,代码来源:LongSpan.java

示例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);
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:30,代码来源:MeterTableCellRenderer.java

示例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);
        }
    }
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:33,代码来源:CollectionHandlerAdapter.java

示例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));
}
 
开发者ID:bramp,项目名称:dissector,代码行数:9,代码来源:HexEditorSkin.java

示例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));
}
 
开发者ID:bramp,项目名称:dissector,代码行数:9,代码来源:HexEditorSkin.java

示例6: process

import org.apache.pivot.collections.Dictionary; //导入依赖的package包/类
@Override
public void process(Dictionary<T, V> list) {
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:4,代码来源:CollectionHandlerAdapter.java

示例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)));
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:6,代码来源:SelectionAdapter.java


注:本文中的org.apache.pivot.collections.Dictionary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。