• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Console类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createConsoleMenu

import sim.display.Console; //导入依赖的package包/类
void createConsoleMenu()
{
if (simulation != null && simulation.controller != null &&
    simulation.controller instanceof Console)
    {
    final Console c = (Console)(simulation.controller);
    JMenuItem consoleMenu = new JMenuItem("Show Console");
    popup.add(consoleMenu);
    consoleMenu.addActionListener(new ActionListener()
        {
        public void actionPerformed(ActionEvent e)
            {
            c.setVisible(true);;
            }
        });
    }
popup.addSeparator();
}
 
开发者ID:minhhn2910,项目名称:g-mason,代码行数:19,代码来源:Display3D.java


示例2: mpaGUI

import sim.display.Console; //导入依赖的package包/类
public static void mpaGUI(String[] args)
{
    PrototypeScenario scenario = new PrototypeScenario();
    scenario.setBiologyInitializer(new OsmoseBiologyFactory());
    scenario.setMapInitializer(new OsmoseMapInitializerFactory());
    scenario.setFishers(100);
    RandomTrawlStringFactory gear = new RandomTrawlStringFactory();
    gear.setCatchabilityMap("3:.01");
    scenario.setGear(gear);

    //mpa rules
    scenario.setRegulation(new ProtectedAreasOnlyFactory());
    scenario.forcePortPosition(new int[]{1,1});

    //now work!
    FishState model = new FishState(System.currentTimeMillis(),1);
    model.setScenario(scenario);
    FishGUI gui = new FishGUI(model);
    Console c = new Console(gui);
    c.setVisible(true);


}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:24,代码来源:OsmoseComparativeStatics.java


示例3: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args) {
	PaySimWithUI vid = new PaySimWithUI();
	//The console is the GUI control which allows us to start/stop/pause etc
	Console c = new Console(vid);
	
	//Make the console visibile
	c.setVisible(true);
}
 
开发者ID:EdgarLopezPhD,项目名称:PaySim,代码行数:9,代码来源:PaySimWithUI.java


示例4: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args) throws IOException {



        JDialog scenarioSelection = new JDialog((JFrame)null,true);

        final ScenarioJComponent scenario = new ScenarioJComponent(new HabitatDeploymentScenario());

        final JPanel contentPane = new JPanel(new BorderLayout());
        contentPane.add(new JScrollPane(scenario.getJComponent()), BorderLayout.CENTER);
        //create ok and exit button
        Box buttonBox = new Box( BoxLayout.LINE_AXIS);
        contentPane.add(buttonBox, BorderLayout.SOUTH);
        final JButton ok = new JButton("OK");
        ok.addActionListener(e -> scenarioSelection.dispatchEvent(new WindowEvent(
                scenarioSelection,WindowEvent.WINDOW_CLOSING
        )));
        buttonBox.add(ok);
        final JButton cancel = new JButton("Cancel");
        cancel.addActionListener(e -> System.exit(0));
        buttonBox.add(cancel);


        scenarioSelection.setContentPane(contentPane);
        scenarioSelection.pack();
        scenarioSelection.setVisible(true);


        FishState state = new FishState(System.currentTimeMillis(),1);
        Log.set(Log.LEVEL_NONE);
        Log.setLogger(new FishStateLogger(state, Paths.get("log.csv")));


        state.setScenario(scenario.getScenario());
        HabitatDeployment vid = new HabitatDeployment(state);
        vid.getPolicyButtons().add(new GearSetterButton());
        Console c = new Console(vid);
        c.setSize(1000, 600);
        c.setVisible(true);
    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:41,代码来源:HabitatDeployment.java


示例5: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args)
{

    FishState state = new FishState();
    PrototypeScenario scenario = new PrototypeScenario();
    scenario.setBiologyInitializer(new FromLeftToRightFactory());
    state.setScenario(scenario);
    scenario.setFishers(1);

    HeatmapTester tester = new HeatmapTester(state);
    Console c = new Console(tester);
    c.setVisible(true);

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:15,代码来源:HeatmapTester.java


示例6: actionPerformed

import sim.display.Console; //导入依赖的package包/类
/**
 * asks to save file
 */
@Override
public void actionPerformed(ActionEvent e)
{

    Console c = (Console) gui.controller;

    if (chooser.showSaveDialog(c) == JFileChooser.APPROVE_OPTION)
    {
        File file = chooser.getSelectedFile();
        String currentExtension = FishStateUtilities.getFilenameExtension(file);
        //if the extension is not correct
        if(!(currentExtension.equalsIgnoreCase("checkpoint")  ))
        {
            //force it!
            file = new File(file.toString() + ".checkpoint");
        }

        //log that you are about to write
        Log.info("going to save model to " + file);
        synchronized (gui.state.schedule)
        {

            gui.preCheckPoint();
            FishStateUtilities.writeModelToFile(file, (FishState) gui.state);
            gui.postCheckPoint();
        }

    } else {
    }

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:35,代码来源:SaveButton.java


示例7: getConsole

import sim.display.Console; //导入依赖的package包/类
public Console getConsole() {
	final Frame[] frames = Frame.getFrames();
	for (final Frame act : frames) {
		if ( act instanceof Console ) {
			final Console console = (Console) act;
			return console;
		}
	}
	
	throw new AssertionError( "Console not found in array of current frames: " + Arrays.toString( frames ) );
}
 
开发者ID:crisis-economics,项目名称:CRISIS,代码行数:12,代码来源:SimulationGui.java


示例8: init

import sim.display.Console; //导入依赖的package包/类
@Override
public void init(final Controller c) {
   super.init(c);
   
   final int
      screenWidth = (int) Math.round(Toolkit.getDefaultToolkit().getScreenSize().getWidth()),
      screenHeight = (int) Math.round(Toolkit.getDefaultToolkit().getScreenSize().getHeight()),
      graphFrameWidth = screenWidth / 2,
      graphFrameHeight = screenHeight / 2;
   
   // Graphs
   chartFrame = new JFrame("Model Statistics [" + modelName + "]");
   c.registerFrame(chartFrame);
   chartFrame.pack();
   chartFrame.setSize(graphFrameWidth, graphFrameHeight);
   chartFrame.setVisible(true);
   
   // Component Visualization
   final Display2D display = new Display2D(screenWidth / 4, screenHeight / 4, this);
   display.setClipping(false);
   subEconomyVisualizationFrame = display.createFrame();
   subEconomyVisualizationFrame.setTitle("Components");
   c.registerFrame(subEconomyVisualizationFrame);
   subEconomyVisualizationFrame.pack();
   subEconomyVisualizationFrame.setVisible(true);
   
   final JTabbedPane tabbedPane = new JTabbedPane();
   chartFrame.add(tabbedPane);
   setupCharts();
   addTabs(tabbedPane);
   
   final Console console = getConsole();
   
   console.setLocation(chartFrame.getLocationOnScreen().x + chartFrame.getWidth(), 0);
   console.setSize(150, graphFrameHeight);
   
}
 
开发者ID:crisis-economics,项目名称:CRISIS,代码行数:38,代码来源:MasterModelGUI.java


示例9: locateFrames

import sim.display.Console; //导入依赖的package包/类
@Override
public void locateFrames(Scenario2DPortrayal scenarioPortrayal) {
	Console console = (Console) this.controller;
	console.setLocation(100, 50);
	console.setSize(500, 400);
	HashMap<String, JFrame> frames = scenarioPortrayal.getFrameList();
	JFrame mainFrame = frames.get(Scenario2DPortrayal.MAIN_DISPLAY_ID);
	mainFrame.setLocation(600, 200);
	mainFrame.setSize(800, 800);
	mainFrame.setVisible(true);
}
 
开发者ID:gsi-upm,项目名称:shanks-wsn-module,代码行数:12,代码来源:WSNSimulation2DGUI.java


示例10: main

import sim.display.Console; //导入依赖的package包/类
/**
 * Executing simulation with GUI, it delegates to SimExample, simulation
 * without GUI
 *
 * @param args
 */
public static void main(String[] args) {
    //simExample = new SimExample(System.currentTimeMillis());
    simExample = new SimExample(1);
    
    switch (demoCode) {//scenario depeding on demo code
        case 1:
            simExample.setPathScenario("./environments/mapExample.ubiksim");
            break;
        case 2:
            simExample.setPathScenario("./environments/primeraPlantaUMU_DIIC.ubiksim");
            break;
            
        case 3:
            simExample.setPathScenario("./environments/twoRooms.ubiksim");
            break;
        default:
            //the file in config.pros will be used
    }
    
    
    SimExampleWithGUI vid = new SimExampleWithGUI(simExample);
    Console c = new Console(vid);
    c.setIncrementSeedOnStop(true);
    c.setVisible(true);
    c.setSize(500, 650);
    c.setIconImage(getLocoIcon().getImage());
   
    
    

}
 
开发者ID:emilioserra,项目名称:UbikSim,代码行数:38,代码来源:SimExampleWithGUI.java


示例11: execute

import sim.display.Console; //导入依赖的package包/类
@Override
public void execute() {
    Configuration configuration = new Configuration();
    String home = getHome().getName();
    configuration.setPathScenario(home);

    Ubik ubik = new Ubik(configuration);
    UbikSimWithUI vid = new UbikSimWithUI(ubik);
    Console c = new Console(vid);
    c.setIncrementSeedOnStop(false);
    c.setVisible(true);
}
 
开发者ID:emilioserra,项目名称:UbikSim,代码行数:13,代码来源:UbikSimPlugin.java


示例12: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args) {
  ProximitySimulationWithGUI proxSimGUI = new ProximitySimulationWithGUI();
  Console c = new Console(proxSimGUI);
  c.setVisible(true);
}
 
开发者ID:casific,项目名称:murmur,代码行数:6,代码来源:ProximitySimulationWithGUI.java


示例13: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args)
{


    final FishState state = new FishState(System.currentTimeMillis());
    //world split in half

    MultiITQFactory multiFactory = new MultiITQFactory();
    //quota ratios: 90-10
    multiFactory.setQuotaFirstSpecie(new FixedDoubleParameter(4500));
    multiFactory.setQuotaOtherSpecies(new FixedDoubleParameter(500));

    HalfBycatchFactory biologyFactory = new HalfBycatchFactory();
    biologyFactory.setCarryingCapacity(new FixedDoubleParameter(5000));
    biologyFactory.setGrower(new SimpleLogisticGrowerFactory(.9));
    biologyFactory.setDifferentialPercentageToMove(new FixedDoubleParameter(.2));
    biologyFactory.setPercentageLimitOnDailyMovement(new FixedDoubleParameter(.2));

    PrototypeScenario scenario = new PrototypeScenario();
    state.setScenario(scenario);
    //world split in half
    scenario.setBiologyInitializer(biologyFactory);
    scenario.setRegulation(multiFactory);

    SimpleMapInitializerFactory simpleMap = new SimpleMapInitializerFactory();
    simpleMap.setCoastalRoughness(new FixedDoubleParameter(0d));
    scenario.setMapInitializer(simpleMap);
    scenario.forcePortPosition(new int[]{40,25});
    //try also 40,25



    scenario.setUsePredictors(true);



    FishGUI vid = new FishGUI(state);
    Console c = new Console(vid);
    c.setVisible(true);

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:42,代码来源:TwoSpeciesITQ.java


示例14: thirdGUI

import sim.display.Console; //导入依赖的package包/类
public static void thirdGUI(String[] args)
{


    final FishState state = new FishState(System.currentTimeMillis());
    //world split in half

    MultiITQFactory multiFactory = new MultiITQFactory();
    //quota ratios: 90-10
    multiFactory.setQuotaFirstSpecie(new FixedDoubleParameter(4500));
    multiFactory.setQuotaOtherSpecies(new FixedDoubleParameter(500));

    HalfBycatchFactory biologyFactory = new HalfBycatchFactory();
    biologyFactory.setCarryingCapacity(new FixedDoubleParameter(5000));
    biologyFactory.setGrower(new SimpleLogisticGrowerFactory(.9));
    biologyFactory.setDifferentialPercentageToMove(new FixedDoubleParameter(.2));
    biologyFactory.setPercentageLimitOnDailyMovement(new FixedDoubleParameter(.2));

    PrototypeScenario scenario = new PrototypeScenario();
    state.setScenario(scenario);
    //world split in half
    scenario.setBiologyInitializer(biologyFactory);
    scenario.setRegulation(multiFactory);

    SimpleMapInitializerFactory simpleMap = new SimpleMapInitializerFactory();
    simpleMap.setCoastalRoughness(new FixedDoubleParameter(0d));
    scenario.setMapInitializer(simpleMap);
    scenario.forcePortPosition(new int[]{40,25});
    //try also 40,25



    scenario.setUsePredictors(true);



    FishGUI vid = new FishGUI(state);
    Console c = new Console(vid);
    c.setVisible(true);

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:42,代码来源:TwoSpeciesITQ.java


示例15: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args) throws IOException {

        OsmoseBiologyFactory biologyFactory = new OsmoseBiologyFactory();
        OsmoseMapInitializerFactory mapInitializer = new OsmoseMapInitializerFactory();

        FishState model = HardGearSwitch.buildHardSwitchGearDemo(biologyFactory, mapInitializer, 3, 2, 400, 800);



        FishGUI gui = new FishGUI(model);
        Console c = new Console(gui);
        c.setVisible(true);



    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:17,代码来源:HardGearSwitch.java


示例16: guiPrototype

import sim.display.Console; //导入依赖的package包/类
public static void guiPrototype(String[] args) throws IOException {


        WellMixedBiologyFactory biologyInitializer = new WellMixedBiologyFactory();
        biologyInitializer.setFirstSpeciesCapacity(new FixedDoubleParameter(5000));
        biologyInitializer.setCapacityRatioSecondToFirst(new FixedDoubleParameter(1d));
        SimpleMapInitializerFactory mapInitializer = new SimpleMapInitializerFactory();

        FishState model = buildHardSwitchGearDemo(biologyInitializer, mapInitializer, 0, 1, 500, 4500);


        FishGUI gui = new FishGUI(model);
        Console c = new Console(gui);
        c.setVisible(true);



    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:19,代码来源:HardGearSwitch.java


示例17: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args) {
	SimulationWithUI vid = new SimulationWithUI();
	Console c = new Console(vid);
	c.setVisible(true);
}
 
开发者ID:rwth-acis,项目名称:REST-OCD-Services,代码行数:6,代码来源:SimulationWithUI.java


示例18: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args){
    MacroIIGUI gui = new MacroIIGUI(new MacroII(System.currentTimeMillis()));
    Console c = new Console(gui);
    c.setVisible(true);
}
 
开发者ID:CarrKnight,项目名称:MacroIIDiscrete,代码行数:6,代码来源:MacroIIGUI.java


示例19: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args){
    DownstreamMonopolistGUI gui = new DownstreamMonopolistGUI(new MacroII(System.currentTimeMillis()));
    Console c = new Console(gui);
    c.setVisible(true);
}
 
开发者ID:CarrKnight,项目名称:MacroIIDiscrete,代码行数:6,代码来源:DownstreamMonopolistGUI.java


示例20: main

import sim.display.Console; //导入依赖的package包/类
public static void main(String[] args){
    UpstreamMonopolistGUI gui = new UpstreamMonopolistGUI(new MacroII(System.currentTimeMillis()));
    Console c = new Console(gui);
    c.setVisible(true);
}
 
开发者ID:CarrKnight,项目名称:MacroIIDiscrete,代码行数:6,代码来源:UpstreamMonopolistGUI.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataKey类代码示例发布时间:2022-05-22
下一篇:
Java CreateSnapshotResponseProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap