本文整理匯總了Java中org.eclipse.ui.IMemento.putFloat方法的典型用法代碼示例。如果您正苦於以下問題:Java IMemento.putFloat方法的具體用法?Java IMemento.putFloat怎麽用?Java IMemento.putFloat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.IMemento
的用法示例。
在下文中一共展示了IMemento.putFloat方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createLayerXml_120_Default
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void createLayerXml_120_Default( final IMemento xmlCategory,
final boolean isEnabled,
final boolean canSetOpacity,
final float opacity,
final String defaultLayerId) {
final DefaultLayer mapDefaultLayer = MapDefaultLayer.getLayer(defaultLayerId);
if (mapDefaultLayer == null) {
return;
}
final IMemento xmlLayer = xmlCategory.createChild(TAG_LAYER);
xmlLayer.putString(ATTR_ID, defaultLayerId);
xmlLayer.putBoolean(ATTR_IS_ENABLED, isEnabled);
xmlLayer.putBoolean(ATTR_IS_DEFAULT_LAYER, true);
// opacity
xmlLayer.putFloat(ATTR_OPACITY, opacity);
xmlLayer.putBoolean(ATTR_CAN_SET_OPACITY, canSetOpacity);
}
示例2: createXmlProfile
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static IMemento createXmlProfile( final XMLMemento xmlMemento,
final int profileId,
final String name,
final String profileImagePath,
final boolean isShadow,
final float shadowValue,
final String resolution) {
final IMemento xmlProfile = xmlMemento.createChild(MEMENTO_CHILD_PROFILE);
xmlProfile.putInteger(TAG_PROFILE_ID, profileId);
xmlProfile.putString(TAG_NAME, name);
xmlProfile.putString(TAG_IMAGE_PATH, profileImagePath);
xmlProfile.putBoolean(TAG_IS_SHADOW, isShadow);
xmlProfile.putString(TAG_RESOLUTION, resolution);
xmlProfile.putFloat(TAG_SHADOW_VALUE, shadowValue);
return xmlProfile;
}
示例3: createXml_FromTrackConfig
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void createXml_FromTrackConfig(final Map25TrackConfig config, final IMemento xmlTourTracks) {
// <Track>
final IMemento xmlConfig = xmlTourTracks.createChild(TAG_TRACK);
{
xmlConfig.putString(ATTR_ID, config.id);
xmlConfig.putString(ATTR_CONFIG_NAME, config.name);
xmlConfig.putInteger(ATTR_ANIMATION_TIME, config.animationTime);
// <Outline>
final IMemento xmlOutline = Util.setXmlRgb(xmlConfig, TAG_OUTLINE, config.outlineColor);
{
xmlOutline.putFloat(ATTR_OUTLINE_WIDTH, config.outlineWidth);
}
}
}
示例4: saveState_30_Bookmarks
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void saveState_30_Bookmarks(final XMLMemento xmlRoot) {
// <AllBookmarks>
final IMemento xmlAllBookmarks = xmlRoot.createChild(TAG_ALL_BOOKMARKS);
for (final MapBookmark bookmark : _allBookmarks) {
// <Bookmark>
final IMemento xmlBookmark = xmlAllBookmarks.createChild(TAG_BOOKMARK);
{
xmlBookmark.putString(ATTR_ID, bookmark.id);
xmlBookmark.putString(ATTR_NAME, bookmark.name);
/*
* Map position
*/
final MapPosition mapPosition = bookmark.getMapPosition();
Util.setXmlDouble(xmlBookmark, ATTR_MAP_POSITION_X, mapPosition.x);
Util.setXmlDouble(xmlBookmark, ATTR_MAP_POSITION_Y, mapPosition.y);
Util.setXmlDouble(xmlBookmark, ATTR_MAP_POSITION_SCALE, mapPosition.scale);
xmlBookmark.putFloat(ATTR_MAP_POSITION_BEARING, mapPosition.bearing);
xmlBookmark.putFloat(ATTR_MAP_POSITION_TILT, mapPosition.tilt);
xmlBookmark.putInteger(ATTR_MAP_POSITION_ZOOM_LEVEL, mapPosition.zoomLevel);
}
}
}
示例5: saveState_Options
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void saveState_Options(final XMLMemento xmlRoot) {
final IMemento xmlOptions = xmlRoot.createChild(TAG_OPTIONS);
{
xmlOptions.putBoolean(ATTR_IS_ANIMATE_LOCATION, isAnimateLocation);
xmlOptions.putFloat(ATTR_ANIMATION_TIME, animationTime);
Util.setXmlEnum(xmlOptions, ATTR_ANIMATION_EASING_TYPE, animationEasingType);
xmlOptions.putBoolean(ATTR_USE_DRAGGED_KEY_NAVIGATION, useDraggedKeyboardNavigation);
}
}
示例6: writeXml
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private void writeXml(final MP mp, final IMemento tagMapProvider) {
final GeoPosition lastUsedPosition = mp.getLastUsedPosition();
final GeoPosition favoritePosition = mp.getFavoritePosition();
/*
* set common fields
*/
tagMapProvider.putString(ATTR_MP_ID, mp.getId());
tagMapProvider.putString(ATTR_MP_NAME, mp.getName());
tagMapProvider.putString(ATTR_MP_DESCRIPTION, mp.getDescription());
tagMapProvider.putString(ATTR_MP_OFFLINE_FOLDER, mp.getOfflineFolder());
// image
tagMapProvider.putInteger(ATTR_MP_IMAGE_SIZE, mp.getTileSize());
tagMapProvider.putString(ATTR_MP_IMAGE_FORMAT, mp.getImageFormat());
// zoom level
tagMapProvider.putInteger(ATTR_MP_ZOOM_LEVEL_MIN, mp.getMinZoomLevel());
tagMapProvider.putInteger(ATTR_MP_ZOOM_LEVEL_MAX, mp.getMaxZoomLevel());
// favorite position
tagMapProvider.putInteger(ATTR_MP_FAVORITE_ZOOM_LEVEL, mp.getFavoriteZoom());
tagMapProvider.putFloat(ATTR_MP_FAVORITE_LATITUDE, favoritePosition == null
? 0.0f
: (float) favoritePosition.latitude);
tagMapProvider.putFloat(ATTR_MP_FAVORITE_LONGITUDE, favoritePosition == null
? 0.0f
: (float) favoritePosition.longitude);
// last used position
tagMapProvider.putInteger(ATTR_MP_LAST_USED_ZOOM_LEVEL, mp.getLastUsedZoom());
tagMapProvider.putFloat(ATTR_MP_LAST_USED_LATITUDE, lastUsedPosition == null
? 0.0f
: (float) lastUsedPosition.latitude);
tagMapProvider.putFloat(ATTR_MP_LAST_USED_LONGITUDE, lastUsedPosition == null
? 0.0f
: (float) lastUsedPosition.longitude);
/*
* add special fields for each map provider
*/
if (mp instanceof MPWms) {
writeXmlWms((MPWms) mp, tagMapProvider);
} else if (mp instanceof MPCustom) {
writeXmlCustom((MPCustom) mp, tagMapProvider);
} else if (mp instanceof MPProfile) {
writeXmlProfile((MPProfile) mp, tagMapProvider);
} else if (mp instanceof MPPlugin) {
// plugin mp can be exported in the map profile
tagMapProvider.putString(ATTR_MP_TYPE, MAP_PROVIDER_TYPE_PLUGIN);
}
}
示例7: createXml_FromMarkerConfig
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void createXml_FromMarkerConfig(final MarkerConfig config, final IMemento xmlMarkers) {
// SET_FORMATTING_OFF
// <Marker>
final IMemento xmlConfig = xmlMarkers.createChild(TAG_MARKER);
{
xmlConfig.putString(ATTR_ID, config.id);
xmlConfig.putString(ATTR_CONFIG_NAME, config.name);
/*
* Marker
*/
xmlConfig.putBoolean( ATTR_IS_SHOW_MARKER_LABEL, config.isShowMarkerLabel);
xmlConfig.putBoolean( ATTR_IS_SHOW_MARKER_POINT, config.isShowMarkerPoint);
xmlConfig.putInteger( ATTR_MARKER_ORIENTATION, config.markerOrientation);
xmlConfig.putInteger( ATTR_MARKER_FILL_OPACITY, config.markerFill_Opacity);
xmlConfig.putInteger( ATTR_MARKER_OUTLINE_OPACITY, config.markerOutline_Opacity);
xmlConfig.putFloat( ATTR_MARKER_OUTLINE_SIZE, config.markerOutline_Size);
xmlConfig.putInteger( ATTR_MARKER_SYMBOL_SIZE, config.markerSymbol_Size);
Util.setXmlRgb(xmlConfig, TAG_MARKER_OUTLINE_COLOR, config.markerOutline_Color);
Util.setXmlRgb(xmlConfig, TAG_MARKER_FILL_COLOR, config.markerFill_Color);
/*
* Cluster
*/
Util.setXmlEnum(xmlConfig, ATTR_CLUSTER_ALGORITHM, config.clusterAlgorithm);
xmlConfig.putInteger( ATTR_CLUSTER_GRID_SIZE, config.clusterGrid_Size);
xmlConfig.putInteger( ATTR_CLUSTER_ORIENTATION, config.clusterOrientation);
xmlConfig.putBoolean( ATTR_IS_MARKER_CLUSTERED, config.isMarkerClustered);
xmlConfig.putInteger( ATTR_CLUSTER_FILL_OPACITY, config.clusterFill_Opacity);
xmlConfig.putInteger( ATTR_CLUSTER_OUTLINE_OPACITY, config.clusterOutline_Opacity);
xmlConfig.putFloat( ATTR_CLUSTER_OUTLINE_SIZE, config.clusterOutline_Size);
xmlConfig.putInteger( ATTR_CLUSTER_SYMBOL_SIZE, config.clusterSymbol_Size);
xmlConfig.putInteger( ATTR_CLUSTER_SYMBOL_WEIGHT, config.clusterSymbol_Weight);
Util.setXmlRgb(xmlConfig, TAG_CLUSTER_OUTLINE_COLOR, config.clusterOutline_Color);
Util.setXmlRgb(xmlConfig, TAG_CLUSTER_FILL_COLOR, config.clusterFill_Color);
}
// SET_FORMATTING_ON
}
示例8: saveColors_30_Vertices
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void saveColors_30_Vertices(final IMemento xmlColor, final Map3ColorProfile colorProfile) {
final IMemento xmlVertices = xmlColor.createChild(TAG_VERTICES);
for (final RGBVertex vertex : colorProfile.getProfileImage().getRgbVertices()) {
final IMemento xmlVertex = xmlVertices.createChild(TAG_VERTEX);
final RGB rgb = vertex.getRGB();
xmlVertex.putInteger(ATTR_VALUE, vertex.getValue());
xmlVertex.putInteger(ATTR_RED, rgb.red);
xmlVertex.putInteger(ATTR_GREEN, rgb.green);
xmlVertex.putInteger(ATTR_BLUE, rgb.blue);
xmlVertex.putFloat(ATTR_OPACITY, vertex.getOpacity());
}
}
示例9: createLayerXml_210_FromTreeChildren
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
/**
* * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* <p>
* RECURSIVE RECURSIVE RECURSIVE RECURSIVE RECURSIVE RECURSIVE RECURSIVE RECURSIVE
* <p>
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* @param parentItem
* @param xmlParent
*/
private static void createLayerXml_210_FromTreeChildren(final TreeViewerItem parentItem, final XMLMemento xmlParent) {
final ArrayList<TreeViewerItem> tviChildren = parentItem.getUnfetchedChildren();
if (tviChildren == null) {
return;
}
for (final TreeViewerItem tviItem : tviChildren) {
if (tviItem instanceof TVIMap3Category) {
final TVIMap3Category tviCategory = (TVIMap3Category) tviItem;
final XMLMemento xmlCategory = (XMLMemento) xmlParent.createChild(TAG_CATEGORY);
xmlCategory.putString(ATTR_ID, tviCategory.getId());
xmlCategory.putBoolean(ATTR_IS_EXPANDED, isCategoryExpanded(tviCategory));
createLayerXml_210_FromTreeChildren(tviItem, xmlCategory);
} else if (tviItem instanceof TVIMap3Layer) {
final TVIMap3Layer tviLayer = (TVIMap3Layer) tviItem;
final IMemento xmlLayer = xmlParent.createChild(TAG_LAYER);
xmlLayer.putString(ATTR_ID, tviLayer.getId());
xmlLayer.putBoolean(ATTR_IS_ENABLED, tviLayer.isLayerVisible);
xmlLayer.putBoolean(ATTR_IS_DEFAULT_LAYER, tviLayer.isDefaultLayer);
xmlLayer.putBoolean(ATTR_CAN_SET_OPACITY, tviLayer.canSetOpacity());
xmlLayer.putFloat(ATTR_OPACITY, tviLayer.getOpacity());
}
}
}
示例10: writeXml_Number_Float
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void writeXml_Number_Float(final IMemento xmlProperty, final double value, final int fieldNo) {
xmlProperty.putFloat(ATTR_VALUE + fieldNo, (float) value);
}