@Override public void viewWillAppear(boolean animated) { super.viewWillAppear(animated); IViewController<T> topViewController = null; if (_topControllerDirection == TopControllerDirectionLeft) { topViewController = getLeftViewController(); if (topViewController != null && !topViewController.isViewAppeared()) { topViewController.viewAppearToSuperView(getContentView(), animated); } } if (_topControllerDirection == TopControllerDirectionRight) { topViewController = getRightViewController(); if (topViewController != null && !topViewController.isViewAppeared()) { topViewController.viewAppearToSuperView(getContentView(), animated); } } topViewController = getCenterViewController(); if (topViewController != null && !topViewController.isViewAppeared()) { topViewController.viewAppearToSuperView(getContentView(), animated); } }
@Override protected void didViewUnLoaded() { IViewController<T> topViewController = null; if (_topControllerDirection == TopControllerDirectionLeft) { topViewController = getLeftViewController(); if (topViewController != null && topViewController.isViewAppeared()) { topViewController.viewRemoveForSuperView(false); } } if (_topControllerDirection == TopControllerDirectionRight) { topViewController = getRightViewController(); if (topViewController != null && topViewController.isViewAppeared()) { topViewController.viewRemoveForSuperView(false); } } topViewController = getCenterViewController(); if (topViewController != null && topViewController.isViewAppeared()) { topViewController.viewRemoveForSuperView(false); } _contentView = null; _gestureDetector = null; super.didViewUnLoaded(); }
/** * Constructs a <code>ConstantEditor</code> using the given model. * * @param theParent the parent container * @param theModel the editor's model * @throws IllegalArgumentException if any of the parameters are <code>null</code> */ public ConstantEditor(Composite theParent, ConstantEditorModel theModel) { super(theParent, Constant.class, theModel); controller = new ViewController(); model = theModel; model.addModelListener(controller); // start the controller controller.initialize(); }
@Override public void onLowMemory() { super.onLowMemory(); if (_leftViewController != null) { _leftViewController.onLowMemory(); } if (_rightViewController != null) { _rightViewController.onLowMemory(); } if (_centerViewController != null) { _centerViewController.onLowMemory(); } }
@Override public void onServiceContextStart() { super.onServiceContextStart(); if (_leftViewController != null) { _leftViewController.onServiceContextStart(); } if (_rightViewController != null) { _rightViewController.onServiceContextStart(); } if (_centerViewController != null) { _centerViewController.onServiceContextStart(); } }
@Override protected void didViewLoaded() { super.didViewLoaded(); _contentView = (ViewGroup) getView().findViewById(R.id.contentView); if (_contentView == null) { _contentView = (ViewGroup) getView(); } if (_gestureDetector == null) { _gestureDetector = new GestureDetector(getContext(), this, getHandler()); } getView().setOnTouchListener(this); }
/** * Laedt eine Konfigurationsdatei und fuegt markierte Multicasts hinzu. * * @param path Pfad zur Konfigurationsdatei, die geladen werden soll. * @param complete Wenn hier true gesetzt ist, wird der Standardpfad genommen und MCD + UID + ULD * geladen. * @param Sender_v4 Wenn true wird Sender_v4 geladen. * @param Sender_v6 Wenn true wird Sender_v6 geladen. * @param Receiver_v4 Wenn true wird Receiver_v4 geladen. * @param Receiver_v6 Wenn true wird Receiver_v4 geladen. */ private void loadConfig( String path, boolean complete, boolean Sender_v4, boolean Sender_v6, boolean Receiver_v4, boolean Receiver_v6) { final String p = "MultiCastor.xml"; // Diese Vektoren werden geladen Vector<MulticastData> multicasts = new Vector<MulticastData>(); String message = new String(); boolean skip = false; if (complete) { try { xml_parser.loadConfig(p, multicasts, userlevelData, userInputData, lastConfigs); logger.log(Level.INFO, "Default Configurationfile loaded."); } catch (Exception e) { if (e instanceof FileNotFoundException) { message = "Default configurationfile was not found. MultiCastor starts without preconfigured Multicasts and with default GUI configuration."; } else if (e instanceof SAXException) { message = "Default configurationfile could not be parsed correctly. MultiCastor starts without preconfigured Multicasts and with default GUI configuration."; } else if (e instanceof IOException) { message = "Default configurationfile could not be loaded. MultiCastor starts without preconfigured Multicasts and with default GUI configuration."; } else if (e instanceof WrongConfigurationException) { message = ((WrongConfigurationException) e).getErrorMessage(); } else if (e instanceof IllegalArgumentException) { message = "Error in default configurationfile."; } else { message = "Unexpected error of type: " + e.getClass(); } skip = true; logger.log(Level.WARNING, message); } } else { try { xml_parser.loadConfig(path, multicasts, userlevelData); logger.log(Level.INFO, "Configurationfile loaded: " + path); } catch (Exception e) { if (e instanceof FileNotFoundException) { message = "Configurationfile not found."; } else if (e instanceof SAXException) { message = "Configurationfile could not be parsed."; } else if (e instanceof IOException) { message = "Configurationfile could not be loaded."; } else if (e instanceof WrongConfigurationException) { message = ((WrongConfigurationException) e).getErrorMessage(); } else if (e instanceof IllegalArgumentException) { message = "Error in configurationfile."; } else { message = "Unexpected error of type: " + e.getClass(); } skip = true; message = message + " Used path: " + path; logger.log(Level.WARNING, message); } } if (!skip) { // Füge Multicast hinzu for (MulticastData m : multicasts) { if (((m.getTyp().equals(Typ.RECEIVER_V4) && Receiver_v4)) || ((m.getTyp().equals(Typ.RECEIVER_V6) && Receiver_v6)) || ((m.getTyp().equals(Typ.SENDER_V4) && Sender_v4)) || ((m.getTyp().equals(Typ.SENDER_V6) && Sender_v6))) { view_controller.addMC(m); } } if (userlevelData.size() < 4) { // log("Error in loadConfigFile - ConfigFile did not contain 12 userLevelData objects (this // is ignored for test purposes)"); logger.log( Level.INFO, "In the Configfile were less than 4 UserlevelData objects. Default ULD will be used."); } } view_controller.loadAutoSave(); }
public static Screen fromController(ViewController controller) { return Screen.fromScoop(controller.getScoop()); }
public static void main(String[] args) { ViewController game = new ViewController(); game.startScreen(); }
@Override public void viewDidDisappear(boolean animated) { super.viewDidDisappear(animated); }