本文整理匯總了Java中java.beans.Beans.setDesignTime方法的典型用法代碼示例。如果您正苦於以下問題:Java Beans.setDesignTime方法的具體用法?Java Beans.setDesignTime怎麽用?Java Beans.setDesignTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.Beans
的用法示例。
在下文中一共展示了Beans.setDesignTime方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MVMapElement
import java.beans.Beans; //導入方法依賴的package包/類
MVMapElement(TLDataObject dataObject) {
// Hack
if (Beans.isDesignTime()) {
Beans.setDesignTime(false);
}
this.dataObject = dataObject;
glPanel = new TLMapGLPanel(dataObject.getDatabase().getMap(), dataObject.getDatabase());
slider = new TLSlider(dataObject.getDatabase());
elementPanel = new JPanel(new BorderLayout());
elementPanel.add(glPanel, BorderLayout.CENTER);
elementPanel.add(slider, BorderLayout.PAGE_END);
ActionMap map = new ActionMap();
map.put("save", SystemAction.get(SaveAction.class));
elementPanel.setActionMap(map);
lookupContent = new InstanceContent();
lookup = new ProxyLookup(dataObject.getLookup(), new AbstractLookup(lookupContent));
}
示例2: test
import java.beans.Beans; //導入方法依賴的package包/類
private static void test(String[] path) {
try {
Beans.setDesignTime(true);
Beans.setGuiAvailable(true);
Introspector.setBeanInfoSearchPath(path);
PropertyEditorManager.setEditorSearchPath(path);
} catch (SecurityException exception) {
throw new Error("unexpected security exception", exception);
}
}
示例3: MapGLPanel
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Create a panel for
* @param caps
* @param map
* @param log
*/
protected MapGLPanel(GLCapabilities caps, IUnrealMap map, Logger log) {
super(caps);
if (Beans.isDesignTime()) {
Beans.setDesignTime(false);
}
this.map = map;
this.logger = log;
Location mapFocus = new Location(
map.getBox().getCenterX(),
map.getBox().getCenterY(),
map.getBox().getCenterZ());
// Stuff for controlling viewpoint in map
mapViewpoint = new MapViewpoint();
mapController = new MapController(this, mapViewpoint, mapFocus);
mapController.registerListeners();
// Create renderers
mapRenderer = new MapRenderer(map, lastGLName++);
agentRenderes = new GLRendererCollection<IRenderableUTAgent>();
environmentRenderer = new EnvironmentRenderer(mapViewpoint, agentRenderes, mapRenderer);
// Add listener so this level is rendered
this.addGLEventListener(environmentRenderer);
// Listen for changes in viewpoint
mapViewpoint.addViewpointListener(this);
// Set initial position of view + thanks to listener display
mapViewpoint.setFromViewedBox(map.getBox());
}
示例4: main
import java.beans.Beans; //導入方法依賴的package包/類
public static void main(String[] args) throws InterruptedException {
if (Beans.isDesignTime()) {
throw new Error("unexpected DesignTime property");
}
Beans.setDesignTime(!Beans.isDesignTime());
ThreadGroup group = new ThreadGroup("$$$");
Thread thread = new Thread(group, new TestDesignTime());
thread.start();
thread.join();
}
示例5: testSetDesignTime
import java.beans.Beans; //導入方法依賴的package包/類
public void testSetDesignTime() {
boolean value = Beans.isDesignTime();
try {
Beans.setDesignTime(true);
assertTrue(Beans.isDesignTime());
Beans.setDesignTime(false);
assertFalse(Beans.isDesignTime());
} finally {
Beans.setDesignTime(value);
}
}
示例6: testSetDesignTime
import java.beans.Beans; //導入方法依賴的package包/類
public void testSetDesignTime() {
boolean value = Beans.isDesignTime();
try {
Beans.setDesignTime(true);
assertTrue(Beans.isDesignTime());
Beans.setDesignTime(false);
assertFalse(Beans.isDesignTime());
} finally {
Beans.setDesignTime(value);
}
}
示例7: testBeansSetDesignTime
import java.beans.Beans; //導入方法依賴的package包/類
public Result testBeansSetDesignTime() {
try {
ssetUp();
Beans.setDesignTime(true);
return failed("SecurityException wasn't throw");
} catch (SecurityException e) {
return passed();
}
}
示例8: install
import java.beans.Beans; //導入方法依賴的package包/類
static void install() {
//Thanks to Scott Kovatch from Apple for this fix - enabling the preferences menu
//requires that Beans.isDesignTime() be false
boolean wasDesignTime = Beans.isDesignTime();
try {
Beans.setDesignTime (false);
al = new NbApplicationAdapter();
Application.getApplication().addApplicationListener(al);
Application.getApplication().setEnabledAboutMenu(true);
Application.getApplication().setEnabledPreferencesMenu(true);
} finally {
Beans.setDesignTime(wasDesignTime);
}
/*
WindowManager.getDefault().addWindowSystemListener(new WindowSystemListener() {
@Override
public void beforeLoad(WindowSystemEvent event) {
WindowManager.getDefault().removeWindowSystemListener(this);
try {
FullScreenUtilities.setWindowCanFullScreen(WindowManager.getDefault().getMainWindow(), true);
} catch( ThreadDeath td ) {
throw td;
} catch( Throwable e ) {
Logger.getLogger(NbApplicationAdapter.class.getName()).log(Level.FINE,
"Error while setting up full screen support.", e );//NOI18N
}
}
@Override
public void afterLoad(WindowSystemEvent event) {
}
@Override
public void beforeSave(WindowSystemEvent event) {
}
@Override
public void afterSave(WindowSystemEvent event) {
}
});
*/
}