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


Java PropertyHandler类代码示例

本文整理汇总了Java中com.bbn.openmap.PropertyHandler的典型用法代码示例。如果您正苦于以下问题:Java PropertyHandler类的具体用法?Java PropertyHandler怎么用?Java PropertyHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyHandler类属于com.bbn.openmap包,在下文中一共展示了PropertyHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findAndInit

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Called when an object is added to the MapHandler.
 */
public void findAndInit(Object someObj) {

    considerForContent(someObj);

    // We shouldn't find this if we've already defined one
    // in the MapPanel, but we have this for backward
    // compatibility.
    if (someObj instanceof JMenuBar) {
        logger.fine("OpenMapFrame: Found a MenuBar");
        getRootPane().setJMenuBar((JMenuBar) someObj);
        invalidate();
    }

    // Only do this if the properties haven't been set on the frame, yet.
    if (someObj instanceof PropertyHandler && !propsInitialized) {
        setProperties(((PropertyHandler) someObj).getProperties());
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:22,代码来源:OpenMapFrame.java

示例2: OpenMap

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Create a new OpenMap framework object - creates a MapPanel, OpenMapFrame,
 * and brings up the layer palettes that are being told to be open at
 * startup. The properties in the PropertyHandler will be used to configure
 * the application. PropertyHandler may be null.
 */
public OpenMap(PropertyHandler propertyHandler) {
    configureMapPanel(propertyHandler);

    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // TODO There's something going on here with the progress
            // reporter and the swing thread that is causing the app to hang
            // in Leopard.
            showInFrame();
        }
    });
}
 
开发者ID:d2fn,项目名称:passage,代码行数:21,代码来源:OpenMap.java

示例3: configureMapPanel

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
protected void configureMapPanel(PropertyHandler propertyHandler) {
    BasicMapPanel basicMapPanel = new BasicMapPanel(propertyHandler, true);
    // Creates the components in the main application thread. If any of
    // these components need to update their GUI, they should hand a
    // Runnable object to the SwingUtilities.invokeLater(Runnable) method,
    // and it will be updated accordingly.
    basicMapPanel.create();
    mapPanel = basicMapPanel;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:10,代码来源:OpenMap.java

示例4: configureMapPanel

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
protected void configureMapPanel(PropertyHandler propertyHandler) {
    OverlayMapPanel mapPanel = new OverlayMapPanel(propertyHandler, true);
    // Creates the components in the main application thread. If any of
    // these components need to update their GUI, they should hand a
    // Runnable object to the SwingUtilities.invokeLater(Runnable) method,
    // and it will be updated accordingly.
    mapPanel.create();
    this.mapPanel = mapPanel;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:10,代码来源:Main.java

示例5: configureMapPanel

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * A method that lets you control what gets added to the application
 * programmatically. These components are required for handling an
 * OMEventHandler, which would be added to the MapHandler. If you wanted to
 * use the standard OpenMap application, you could add these components to
 * the MapHandler, instead.
 */
protected void configureMapPanel(PropertyHandler propertyHandler) {
    super.configureMapPanel(propertyHandler);
    MapHandler mapHandler = mapPanel.getMapHandler();

    HotwashPanel hotwashPanel = new HotwashPanel();
    String hotwash = "hotwash";
    // This is important - the property prefix is checked against parent
    // names of MapPanelChildren, so the HotwashPanel can figure out what
    // goes to itself vs. the BasicMapPanel holding the map.
    hotwashPanel.setPropertyPrefix(hotwash);
    mapHandler.add(hotwashPanel);

    mapHandler.add(new OMEventSelectionCoordinator());

    TimePanel timePanel = new TimePanel();
    timePanel.setParentName(hotwash);
    mapHandler.add(timePanel);

    EventPanel eventPanel = new EventPanel();
    eventPanel.setParentName(hotwash);
    mapHandler.add(eventPanel);

    EventListPresenter eventListPresenter = new EventListPresenter();
    mapHandler.add(eventListPresenter);

    mapHandler.add(new Clock());
}
 
开发者ID:d2fn,项目名称:passage,代码行数:35,代码来源:TimeFrameApp.java

示例6: findAndInit

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Looks for PropertyHandler and LayerHandler.
 */
public void findAndInit(Object someObj) {
    if (someObj instanceof PropertyHandler) {
        // do the initializing that need to be done here
        Debug.message("layerspanel", "LayerAddPanel found a LayerHandler");
        propertyHandler = (PropertyHandler) someObj;
    }
    if (someObj instanceof LayerHandler) {
        layerHandler = (LayerHandler) someObj;
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:14,代码来源:LayerAddPanel.java

示例7: findAndUndo

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Disconnect from any objects that are removed from MapHandler.
 */
public void findAndUndo(Object someObj) {
    if (someObj instanceof PropertyHandler && propertyHandler == someObj) {
        // do the initializing that need to be done here
        Debug.message("addable", "LayerAddPanel removing PropertyHandler");
        propertyHandler = null;
    }
    if (someObj instanceof LayerHandler && someObj == layerHandler) {
        Debug.message("addable", "LayerAddPanel removing LayerHandler");
        layerHandler = null;
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:15,代码来源:LayerAddPanel.java

示例8: main

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/** Test cases. */
public static void main(String[] args) {
    LayerAddPanel lap = new LayerAddPanel(new PropertyHandler(), null);
    Layer[] layers = new Layer[1];
    layers[0] = new com.bbn.openmap.layer.shape.ShapeLayer();

    lap.createPanel(layers);
}
 
开发者ID:d2fn,项目名称:passage,代码行数:9,代码来源:LayerAddPanel.java

示例9: BasicMapPanel

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Create a MapPanel that configures itself with properties contained in the
 * PropertyHandler provided, and with the option of delaying the search for
 * properties until the <code>create()</code> call is made.
 * 
 * @param delayCreation true to let the MapPanel know that the artful
 *        programmer will call <code>create()</code>
 */
public BasicMapPanel(PropertyHandler propertyHandler, boolean delayCreation) {
    MapHandler mh = getMapHandler();
    mh.add(this);

    setPropertyHandler(propertyHandler);
    if (!delayCreation) {
        create();
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:18,代码来源:BasicMapPanel.java

示例10: createComponents

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * The constructor calls this method that creates the MapHandler and
 * MapBean, and then tells the PropertyHandler to create the components
 * described in its properties. This method calls getMapHandler() and
 * getMapBean(). If the PropertyHandler is not null, it will be called to
 * created components based on its properties, and those components will be
 * added to the MapHandler in this MapPanel.
 */
protected void createComponents() {
    // Make this call first to load the properties into
    // Environment, before the MapBean gets created.
    PropertyHandler ph = getPropertyHandler();
    // Make sure the MapBean is created and added to the
    // MapHandler.
    MapBean mb = getMapBean();
    MapHandler mh = getMapHandler();
    ph.createComponents(getMapHandler());

    // At this point, check the MapHandler to see if a
    // ProjectionFactory has been added. If it hasn't, create one
    // with the default ProjectionLoaders. We might want to
    // remove this at some point, but not having it here will
    // catch some people by surprise when 4.6.1 comes out.
    Object obj = mh.get(com.bbn.openmap.proj.ProjectionFactory.class);
    if (obj == null) {
        Debug.message("basic",
                      "BasicMapPanel adding ProjectionFactory and projections to MapHandler since there are none to be found.");
        mh.add(ProjectionFactory.loadDefaultProjections());
    }

    // Environment will only get loaded after the property file is
    // read.
    mb.setProjection(mb.getProjectionFactory().getDefaultProjectionFromEnvironment(Environment.getInstance()));
    mb.setBckgrnd(Environment.getCustomBackgroundColor());
}
 
开发者ID:d2fn,项目名称:passage,代码行数:36,代码来源:BasicMapPanel.java

示例11: getPropertyHandler

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Get the PropertyHandler containing properties used to configure the
 * panel, creating it if it doesn't exist.
 */
public PropertyHandler getPropertyHandler() {
    if (propertyHandler == null) {
        setPropertyHandler(new PropertyHandler());
    }
    return propertyHandler;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:11,代码来源:BasicMapPanel.java

示例12: setPropertyHandler

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Set the PropertyHandler containing the properties used to configure this
 * panel. Adds the PropertyHandler to the MapHandler. If the MapHandler
 * isn't set at this point, it will be created via a getMapHandler() call.
 */
public void setPropertyHandler(PropertyHandler handler) {
    propertyHandler = handler;
    if (handler != null) {
        getMapHandler().add(handler);

        setProperties(handler.getPropertyPrefix(), handler.getProperties());
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:14,代码来源:BasicMapPanel.java

示例13: main

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/** A main() method that just brings up a JFrame containing the MapPanel. */
public static void main(String argv[]) {
   SwingUtilities.invokeLater(new Runnable() {

      public void run() {
         JFrame f = new JFrame("Map");
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         OverlayMapPanel map = new OverlayMapPanel(new PropertyHandler(new Properties()), true);
         map.create();

         map.getMapBean().setBackgroundColor(new Color(0x99b3cc));
         map.addMapComponent(new LayerHandler());
         map.addMapComponent(new MouseDelegator());
         map.addMapComponent(new OMMouseMode());
         ShapeLayer shapeLayer = new ShapeLayer("share/data/shape/cntry02/cntry02.shp");
         // shapeLayer.setAddAsBackground(true);
         map.addMapComponent(shapeLayer);
         map.includeExitMenuItem();
         f.setJMenuBar(map.getMapMenuBar());
         f.getContentPane().add(map);
         f.setSize(800, 600);
         f.setVisible(true);
      }

   });

}
 
开发者ID:d2fn,项目名称:passage,代码行数:28,代码来源:OverlayMapPanel.java

示例14: TimeFrameApp

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
public TimeFrameApp(PropertyHandler propertyHandler) {
    super(propertyHandler);
}
 
开发者ID:d2fn,项目名称:passage,代码行数:4,代码来源:TimeFrameApp.java

示例15: LayerAddPanel

import com.bbn.openmap.PropertyHandler; //导入依赖的package包/类
/**
 * Creates the LayerPanel.
 * 
 * @param l the LayerHandler controlling the layers.
 */
public LayerAddPanel(PropertyHandler p, LayerHandler l) {
    this();
    propertyHandler = p;
    layerHandler = l;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:11,代码来源:LayerAddPanel.java


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