@Override public void enter(GameContainer gc, StateBasedGame sbg) throws SlickException { AllowClick = false; textHandle.updateFontSize(); super.enter(gc, sbg); backgroundColor = new Color(0, 0, 0, Properties.BackgroundTransparency); }
@Override protected void handleEvent(AppEvent event) { super.handleEvent(event); EventType type = event.getType(); if (type == AppEvents.MANAGEMENT_VIEW_EVENT) { onActivateView(); } }
@Override protected void onActivateView() { super.onActivateView(); ManagementServiceAsync rpcService = Registry.get(PIGE.MANAGEMENT_SERVICE); rpcService.getConfigurations( new AsyncCallback<ServerConfigs>() { @Override public void onSuccess(ServerConfigs configs) { String mm = configs.getValue(ServerConfigs.ATT_MAINTENANCE_MODE_ACTIVATED); if (mm != null && Boolean.parseBoolean(mm)) { maintenanceModeActivated = Boolean.TRUE; mmActivatedBtn.toggle(Boolean.TRUE); } else { maintenanceModeActivated = Boolean.FALSE; mmDeactivatedBtn.toggle(Boolean.TRUE); } String mmInfo = configs.getValue(ServerConfigs.ATT_MAINTENANCE_MODE_INFO); if (mmInfo != null && !mmInfo.isEmpty()) { mmInfoArea.setValue(mmInfo); } String es = configs.getValue(ServerConfigs.ATT_EMAIL_ENABLED); if (es != null && Boolean.parseBoolean(es)) { emailServiceEnabled = Boolean.TRUE; emailEnabledBtn.toggle(Boolean.TRUE); } else { emailServiceEnabled = Boolean.FALSE; emailDisabledBtn.toggle(Boolean.TRUE); } String ltv = configs.getValue(ServerConfigs.LOAN_TERM_VERIFICATOR_ENABLED); if (ltv != null && Boolean.parseBoolean(ltv)) { ltvEnabled = Boolean.TRUE; ltvEnabledBtn.toggle(Boolean.TRUE); } else { ltvEnabled = Boolean.FALSE; ltvDisabledBtn.toggle(Boolean.TRUE); } String mrs = configs.getValue(ServerConfigs.MAINTENANCE_RECALL_SERVICE_ENABLED); if (mrs != null && Boolean.parseBoolean(mrs)) { mrsEnabled = Boolean.TRUE; mrsEnabledBtn.toggle(Boolean.TRUE); } else { mrsEnabled = Boolean.FALSE; mrsDisabledBtn.toggle(Boolean.TRUE); } } @Override public void onFailure(Throwable caught) { PIGE.handleException(caught); } }); }
@Override protected void onDraw(Canvas canvas) { if (downFlag == -1) { canvas.drawBitmap(normal, null, new Rect(0, 0, 322, 322), paint); } else if (downFlag == 0) { canvas.drawBitmap(up_actived, null, new Rect(0, 0, 322, 322), paint); } else if (downFlag == 1) { canvas.drawBitmap(down_actived, null, new Rect(0, 0, 322, 322), paint); } else if (downFlag == 2) { canvas.drawBitmap(left_actived, null, new Rect(0, 0, 322, 322), paint); } else if (downFlag == 3) { canvas.drawBitmap(right_actived, null, new Rect(0, 0, 322, 322), paint); } super.onDraw(canvas); }
@Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); adapter = new SaleAdapter(goods, context); ll_task_loading.setVisibility(View.INVISIBLE); if (goods.size() <= 0) { Toast.makeText(context, "没有符合条件的商品", Toast.LENGTH_SHORT).show(); ll_empty.setVisibility(View.VISIBLE); fr_not_empty.setVisibility(View.GONE); } else { ll_empty.setVisibility(View.GONE); fr_not_empty.setVisibility(View.VISIBLE); lv_search_good.setAdapter(adapter); adapter.notifyDataSetChanged(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.outputui); // 2 parameters were passed to this activity, retrieve those here Intent intent = getIntent(); String searchResult = intent.getStringExtra(BlueMobileApp._SEARCH_RESULT_MSG); String seeds = intent.getStringExtra(BlueMobileApp._KEYWORD_MSG); Log.i("Response in output", searchResult); try { matchResponse = MatchResponse.formatResponse(searchResult, seeds); } catch (JSONException e) { e.printStackTrace(); } expListViewTips = (ExpandableListView) findViewById(R.id.lv_Tips); expListViewTips.setVisibility(View.VISIBLE); showTips(); }
@Override public void gotoActivity(Intent intent) { mView.gotoActivity(intent); }
@Override public Activity getActivity() { return mView.getActivity(); }
@Override public boolean exist() { return mView.exist(); }
@Override public boolean isCurrView() { return mView.isCurrView(); }
@Override protected void initialize() { super.initialize(); final CardLayout layout = new CardLayout(); final ContentPanel sectionPanel = new ContentPanel(); sectionPanel.setHeaderVisible(Boolean.FALSE); sectionPanel.setLayout(layout); sectionPanel.setBodyBorder(Boolean.FALSE); sectionPanel.setBorders(Boolean.FALSE); sectionPanel.setBodyStyle("border: 0px solid black;"); TreeStore<TreeModel> treeStore = new TreeStore<TreeModel>(); TreePanel<TreeModel> treePanel = new TreePanel<TreeModel>(treeStore); treePanel.setWidth(150); treePanel.setDisplayProperty("id"); treePanel.addStyleName("pige-help-topic-list-panel"); TreePanelSelectionModel treeSelectionModel = new TreePanelSelectionModel(); treeSelectionModel.setSelectionMode(SelectionMode.SINGLE); treeSelectionModel.bindTree(treePanel); treeSelectionModel.addSelectionChangedListener( new SelectionChangedListener<SectionNode>() { @Override public void selectionChanged(SelectionChangedEvent<SectionNode> se) { SectionNode node = se.getSelectedItem(); ContentPanel c = node.getContent(); if (c != null) { layout.setActiveItem(c); sectionPanel.layout(); } } }); Role role = Registry.get(PIGE.ROLE_OBJECT); if (role.getAppManagement()) { sectionPanel.add(getGeneralSection()); SectionNode generalSectionNode = new SectionNode(messages.general(), getGeneralSection()); treeStore.add(generalSectionNode, true); } if (role.getManageLoan()) { sectionPanel.add(getLateLoanReportSection()); SectionNode reportSectionNode = new SectionNode(messages.reports()); SectionNode lateLoanReportSectionNode = new SectionNode(messages.lateLoans(), getLateLoanReportSection()); reportSectionNode.add(lateLoanReportSectionNode); treeStore.add(reportSectionNode, true); } BorderLayoutData westLD = new BorderLayoutData(LayoutRegion.WEST, 175); westLD.setMargins(new Margins(0, 0, 0, 0)); westLD.setSplit(Boolean.TRUE); BorderLayoutData centerLD = new BorderLayoutData(LayoutRegion.CENTER); contentPanel.setBodyStyle("background-color: white;"); contentPanel.add(treePanel, westLD); contentPanel.add(sectionPanel, centerLD); contentPanel.layout(); ContentPanel panel = Registry.get(AppWidgets.APP_CONTENT_PANEL); panel.add(contentPanel); panel.layout(); }
protected JButton createSaveButton() { JButton button = new JButton("Save"); button.addActionListener( actionEvent -> { if (actionEvent.getSource() == saveButton) { try { AddViewController addController = (AddViewController) controller; User user = new User(); String fullName = fullNameField.getText(); String age = ageField.getText(); String email = emailField.getText(); String phone = phoneNumberField.getText(); boolean fullNameIsCorrect = false; boolean phoneIsCorrect = false; boolean emailIsCorrect = false; boolean ageIsCorrect = false; try { user.setFullName(checkFullName(fullNameField.getText())); fullNameIsCorrect = true; } catch (IllegalArgumentException e) { fullNameField.setText("Must be not empty"); } try { user.setAge(checkAge(ageField.getText())); ageIsCorrect = true; } catch (IllegalArgumentException e) { ageField.setText("Incorrect age, must be 0-100"); } try { user.setEmail(checkEmail(emailField.getText())); emailIsCorrect = true; } catch (IllegalArgumentException e) { emailField.setText("Incorrect email"); } try { user.setPhoneNumber(checkPhoneNumber(phoneNumberField.getText())); phoneIsCorrect = true; } catch (IllegalArgumentException e) { phoneNumberField.setText("Phone must be XXXXXXXXXX"); } if (!(fullNameIsCorrect && ageIsCorrect && phoneIsCorrect && emailIsCorrect)) return; user.setFullName(fullName); user.setAge(Integer.parseInt(age)); user.setEmail(email); user.setPhoneNumber(phone); addController.save(user); BaseView.updateUI(model.getAllSorted()); addController.cancel(); clearTextFields(); } catch (StorageException e) { JOptionPane.showMessageDialog(frame, e.getMessage()); } } }); return button; }
@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); postInvalidate(); }
@Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); releaseAvatar(); loader.cancelRequest(this); }