private void setLblMouseClicked( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_setLblMouseClicked UserSettings u = new UserSettings(); u.setVisible(true); this.setVisible(false); } // GEN-LAST:event_setLblMouseClicked
/** * Creates a {@link com.csvreader.CsvWriter CsvWriter} object using a Writer to write data to. * * @param outputStream The stream to write the column delimited data to. * @param delimiter The character to use as the column delimiter. */ public CsvWriter(Writer outputStream, char delimiter) { if (outputStream == null) { throw new IllegalArgumentException("Parameter outputStream can not be null."); } this.outputStream = outputStream; userSettings.Delimiter = delimiter; initialized = true; }
ScatterPlotPanel(TopComponent parentDialog, String helpId) { super(parentDialog, helpId, CHART_TITLE, false); userSettingsMap = new HashMap<>(); productRemovedListener = new ProductManager.Listener() { @Override public void productAdded(ProductManager.Event event) {} @Override public void productRemoved(ProductManager.Event event) { final UserSettings userSettings = userSettingsMap.remove(event.getProduct()); if (userSettings != null) { userSettings.dispose(); } } }; xAxisRangeControl = new AxisRangeControl("X-Axis"); yAxisRangeControl = new AxisRangeControl("Y-Axis"); scatterPlotModel = new ScatterPlotModel(); bindingContext = new BindingContext(PropertyContainer.createObjectBacked(scatterPlotModel)); scatterpointsDataset = new XYIntervalSeriesCollection(); acceptableDeviationDataset = new XYIntervalSeriesCollection(); regressionDataset = new XYIntervalSeriesCollection(); r2Annotation = new XYTitleAnnotation(0, 0, new TextTitle("")); chart = ChartFactory.createScatterPlot( CHART_TITLE, "", "", scatterpointsDataset, PlotOrientation.VERTICAL, true, true, false); chart.getXYPlot().setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); createDomainAxisChangeListener(); final PropertyChangeListener userSettingsUpdateListener = evt -> { if (getRaster() != null) { final VectorDataNode pointDataSourceValue = scatterPlotModel.pointDataSource; final AttributeDescriptor dataFieldValue = scatterPlotModel.dataField; final UserSettings userSettings = getUserSettings(getRaster().getProduct()); userSettings.set(getRaster().getName(), pointDataSourceValue, dataFieldValue); } }; bindingContext.addPropertyChangeListener(PROPERTY_NAME_DATA_FIELD, userSettingsUpdateListener); bindingContext.addPropertyChangeListener( PROPERTY_NAME_POINT_DATA_SOURCE, userSettingsUpdateListener); }
@Override protected void fromJSON(JSONObject object, UserSettings user) throws JSONException { user.setFirstName(getString(object, FIRST_NAME)); user.setLastName(getString(object, LAST_NAME)); user.setAutoPostFacebook(getBoolean(object, AUTO_POST_FACEBOOK, false)); user.setAutoPostTwitter(getBoolean(object, AUTO_POST_TWITTER, false)); user.setLocationEnabled(getBoolean(object, SHARE_LOCATION, true)); user.setNotificationsEnabled(getBoolean(object, NOTIFICATIONS_ENABLED, true)); user.setShowAuthDialog(getBoolean(object, SHOW_AUTH, true)); }
@Override protected void onPause() { super.onPause(); // Persist changes EditText baseUrl = (EditText) findViewById(R.id.baseUrlEditText); Spinner logSpinner = (Spinner) findViewById(R.id.logLevelSpinner); UserSettings settingsToPersist = mConferenceManager.retrieveSettings(); String baseUrlStr = baseUrl.getText().toString(); String appId = mAppIdView.getText().toString(); String appToken = mTokenTextView.getText().toString(); String logLevel = (String) logSpinner.getSelectedItem(); if (!settingsToPersist.BaseURL.equalsIgnoreCase(baseUrlStr) || !settingsToPersist.AppId.equals(appId) || !settingsToPersist.AppToken.equals(appToken)) { settingsToPersist.BaseURL = baseUrlStr; settingsToPersist.AppId = appId; settingsToPersist.AppToken = appToken; mConferenceManager.resetFlagSdkInited(); } settingsToPersist.CurrentLogLevel = LogLevel.fromString(logLevel); mConferenceManager.persistSettings(settingsToPersist); try { mConferenceManager.loadDataFromSettings(); } catch (Exception e) { AlertDialog.Builder popupBuilder = new AlertDialog.Builder(this); TextView myMsg = new TextView(this); myMsg.setText("An Error occured while selecting devices"); myMsg.setGravity(Gravity.CENTER_HORIZONTAL); popupBuilder.setView(myMsg); } }
/** * Creates a {@link com.csvreader.CsvWriter CsvWriter} object using a file as the data * destination. * * @param fileName The path to the file to output the data. * @param delimiter The character to use as the column delimiter. * @param charset The {@link java.nio.charset.Charset Charset} to use while writing the data. */ public CsvWriter(String fileName, char delimiter, Charset charset) { if (fileName == null) { throw new IllegalArgumentException("Parameter fileName can not be null."); } if (charset == null) { throw new IllegalArgumentException("Parameter charset can not be null."); } this.fileName = fileName; userSettings.Delimiter = delimiter; this.charset = charset; }
/** @see nl.lxtreme.ols.api.Configurable#writePreferences(nl.lxtreme.ols.api.UserSettings) */ @Override public void writePreferences(final UserSettings aSettings) { aSettings.putInt("rxd", this.rxd.getSelectedIndex()); aSettings.putInt("txd", this.txd.getSelectedIndex()); aSettings.putInt("cts", this.cts.getSelectedIndex()); aSettings.putInt("rts", this.rts.getSelectedIndex()); aSettings.putInt("dtr", this.dtr.getSelectedIndex()); aSettings.putInt("dsr", this.dsr.getSelectedIndex()); aSettings.putInt("dcd", this.dcd.getSelectedIndex()); aSettings.putInt("ri", this.ri.getSelectedIndex()); aSettings.putInt("parity", this.parity.getSelectedIndex()); aSettings.putInt("bits", this.bits.getSelectedIndex()); aSettings.putInt("stop", this.stop.getSelectedIndex()); aSettings.putBoolean("inverted", this.inv.isSelected()); }
@Override protected void updateComponents() { super.updateComponents(); if (!isVisible()) { return; } final AttributeDescriptor dataField = scatterPlotModel.dataField; xAxisRangeControl.setTitleSuffix(dataField != null ? dataField.getLocalName() : null); final RasterDataNode raster = getRaster(); yAxisRangeControl.setTitleSuffix(raster != null ? raster.getName() : null); if (raster != null) { final Product product = getProduct(); final String rasterName = raster.getName(); final UserSettings userSettings = getUserSettings(product); final VectorDataNode userSelectedPointDataSource = userSettings.getPointDataSource(rasterName); final AttributeDescriptor userSelectedDataField = userSettings.getDataField(rasterName); correlativeFieldSelector.updatePointDataSource(product); correlativeFieldSelector.updateDataField(); if (userSelectedPointDataSource != null) { correlativeFieldSelector.tryToSelectPointDataSource(userSelectedPointDataSource); } if (userSelectedDataField != null) { correlativeFieldSelector.tryToSelectDataField(userSelectedDataField); } } if (isRasterChanged()) { getPlot().getRangeAxis().setLabel(StatisticChartStyling.getAxisLabel(raster, "X", false)); computeChartDataIfPossible(); } }
private void loadSettings() { if (settings.getProperty(UserSettings.DIRECTION) != null) { direction = Direction.valueOf(settings.getProperty(UserSettings.DIRECTION)); nodeLayout = NodeLayout.valueOf(settings.getProperty(UserSettings.LAYOUT)); order = SortOrder.valueOf(settings.getProperty(UserSettings.ORDER)); } if (settings.getProperty(UserSettings.LAST_LOCATION) != null) { final File file = settings.getFile(UserSettings.LAST_LOCATION); clicked(load(file)); } }
protected void setUp() throws Exception { super.setUp(); TUserSettings = getActivity(); TetNewPassword = (EditText) TUserSettings.findViewById(R.id.etNewPassword); TetNewPassword2 = (EditText) TUserSettings.findViewById(R.id.etNewPassword2); TetNewEmail = (EditText) TUserSettings.findViewById(R.id.etNewEmail); TetNewEmail2 = (EditText) TUserSettings.findViewById(R.id.etNewEmail2); TtvCurrentEmail = (TextView) TUserSettings.findViewById(R.id.textView6); TtvCurrentPassword = (TextView) TUserSettings.findViewById(R.id.textView4); setActivityInitialTouchMode(true); }
/** {@inheritDoc} */ @Override public void readPreferences(final UserSettings aSettings) { // Issue #114: avoid setting illegal values... setComboBoxIndex(this.rxd, aSettings, "rxd"); setComboBoxIndex(this.txd, aSettings, "txd"); setComboBoxIndex(this.cts, aSettings, "cts"); setComboBoxIndex(this.rts, aSettings, "rts"); setComboBoxIndex(this.dtr, aSettings, "dtr"); setComboBoxIndex(this.dsr, aSettings, "dsr"); setComboBoxIndex(this.dcd, aSettings, "dcd"); setComboBoxIndex(this.ri, aSettings, "ri"); this.parity.setSelectedIndex(aSettings.getInt("parity", this.parity.getSelectedIndex())); this.bits.setSelectedIndex(aSettings.getInt("bits", this.bits.getSelectedIndex())); this.stop.setSelectedIndex(aSettings.getInt("stop", this.stop.getSelectedIndex())); this.idleLevel.setSelectedIndex( aSettings.getInt("idle-state", this.idleLevel.getSelectedIndex())); this.bitEncoding.setSelectedIndex( aSettings.getInt("bit-encoding", this.bitEncoding.getSelectedIndex())); this.bitOrder.setSelectedIndex(aSettings.getInt("bit-order", this.bitOrder.getSelectedIndex())); this.baudrate.setSelectedItem(Integer.valueOf(aSettings.getInt("baudrate", 9600))); this.autoDetectBaudRate.setSelected( aSettings.getBoolean("auto-baudrate", this.autoDetectBaudRate.isSelected())); }
public List<Monitoria> getMonitoriasPorAluno() { Aluno aluno = (Aluno) userSettings.getUsuario(); return monitoriaService.obterMonitoriasPorAluno(aluno); }
/** * Sets the character to use as the record delimiter. * * @param recordDelimiter The character to use as the record delimiter. Default is combination of * standard end of line characters for Windows, Unix, or Mac. */ public void setRecordDelimiter(char recordDelimiter) { useCustomRecordDelimiter = true; userSettings.RecordDelimiter = recordDelimiter; }
/** * Sets the character to use as the column delimiter. * * @param delimiter The character to use as the column delimiter. */ public void setDelimiter(char delimiter) { userSettings.Delimiter = delimiter; }
public List<Disciplina> getDisciplinasOfertadasParaMonitoria() throws NegocioException { Aluno aluno = (Aluno) userSettings.getUsuario(); return disciplinaService.obterDisciplinasPorCursoDoPeriodoAtual(aluno.getCurso()); }
protected ModelAndView handleRequestInternal( HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); // String id = request.getParameter("id"); // MediaFile mediaFile = mediaFileService.getMediaFile(path); int listOffset = DEFAULT_LIST_OFFSET; int listSize = DEFAULT_LIST_SIZE; String listType = DEFAULT_LIST_TYPE; User user = securityService.getCurrentUser(request); String username = user.getUsername(); UserSettings userSettings = settingsService.getUserSettings(username); int userGroupId = securityService.getCurrentUserGroupId(request); if (request.getParameter("listOffset") != null) { listOffset = Math.max( 0, Math.min(Integer.parseInt(request.getParameter("listOffset")), MAX_LIST_OFFSET)); } if (request.getParameter("listSize") != null) { listSize = Math.max(0, Math.min(Integer.parseInt(request.getParameter("listSize")), MAX_LIST_SIZE)); } if (request.getParameter("listType") != null) { listType = String.valueOf(request.getParameter("listType")); } List<MediaFile> songs; if ("topplayed".equals(listType)) { songs = mediaFileDao.getTopPlayedCountForUser(listOffset, listSize, username); } else if ("otheruser".equals(listType)) { songs = mediaFileDao.getLastPlayedCountForAllUser(listOffset, listSize, userGroupId); } else if ("overall".equals(listType)) { songs = mediaFileDao.getTopPlayedCountForAllUser(listOffset, listSize, userGroupId); } else if ("lastplayed".equals(listType)) { songs = mediaFileDao.getLastPlayedCountForUser(listOffset, listSize, username); } else { songs = mediaFileDao.getLastPlayedCountForAllUser(0, 1, userGroupId); } mediaFileService.populateStarredDate(songs, username); map.put("user", user); map.put("songs", songs); map.put("partyModeEnabled", userSettings.isPartyModeEnabled()); map.put("player", playerService.getPlayer(request, response)); map.put("listOffset", listOffset); map.put("listSize", listSize); map.put("listType", listType); // map.put("starred", mediaFileService.getMediaFileStarredDate(dir.getId(), username) != null); ModelAndView result = super.handleRequestInternal(request, response); result.addObject("model", map); return result; }
/** * Sets the character to use as a text qualifier in the data. * * @param textQualifier The character to use as a text qualifier in the data. */ public void setTextQualifier(char textQualifier) { userSettings.TextQualifier = textQualifier; }
/** @see nl.lxtreme.ols.api.Configurable#writePreferences(nl.lxtreme.ols.api.UserSettings) */ @Override public void writePreferences(final UserSettings aSettings) { aSettings.putInt("rxd", this.rxd.getSelectedIndex()); aSettings.putInt("txd", this.txd.getSelectedIndex()); aSettings.putInt("cts", this.cts.getSelectedIndex()); aSettings.putInt("rts", this.rts.getSelectedIndex()); aSettings.putInt("dtr", this.dtr.getSelectedIndex()); aSettings.putInt("dsr", this.dsr.getSelectedIndex()); aSettings.putInt("dcd", this.dcd.getSelectedIndex()); aSettings.putInt("ri", this.ri.getSelectedIndex()); aSettings.putInt("parity", this.parity.getSelectedIndex()); aSettings.putInt("bits", this.bits.getSelectedIndex()); aSettings.putInt("stop", this.stop.getSelectedIndex()); aSettings.putInt("idle-state", this.idleLevel.getSelectedIndex()); aSettings.putInt("bit-encoding", this.bitEncoding.getSelectedIndex()); aSettings.putInt("bit-order", this.bitOrder.getSelectedIndex()); aSettings.putInt("baudrate", ((Integer) this.baudrate.getSelectedItem()).intValue()); aSettings.putBoolean("auto-baudrate", this.autoDetectBaudRate.isSelected()); }
/** * Sets whether text qualifiers will be used while writing data or not. * * @param useTextQualifier Whether to use a text qualifier while writing data or not. */ public void setUseTextQualifier(boolean useTextQualifier) { userSettings.UseTextQualifier = useTextQualifier; }
@Override protected void toJSON(UserSettings user, JSONObject object) throws JSONException { String encoded = null; try { if (user.getImage() != null) { encoded = bitmapUtils.encode(user.getImage()); } else if (user.getLocalImagePath() != null) { BitmapFactory.Options bfo = new BitmapFactory.Options(); bfo.inDither = true; bfo.inSampleSize = 4; Bitmap bm = BitmapFactory.decodeFile(user.getLocalImagePath(), bfo); encoded = bitmapUtils.encode(bm); bm.recycle(); user.setLocalImagePath(null); } } catch (Throwable e) { // TODO: Handle OOM errors by changing sample size on profile images e.printStackTrace(); } object.put(FIRST_NAME, user.getFirstName()); object.put(LAST_NAME, user.getLastName()); if (encoded != null) { object.put(IMAGE_DATA, encoded); } object.put(AUTO_POST_FACEBOOK, user.isAutoPostFacebook()); object.put(AUTO_POST_TWITTER, user.isAutoPostTwitter()); object.put(SHARE_LOCATION, user.isLocationEnabled()); object.put(NOTIFICATIONS_ENABLED, user.isNotificationsEnabled()); object.put(SHOW_AUTH, user.isShowAuthDialog()); }
public void setEscapeMode(int escapeMode) { userSettings.EscapeMode = escapeMode; }
public void setComment(char comment) { userSettings.Comment = comment; }
/** * Use this to force all fields to be surrounded by the text qualifier even if the qualifier is * not necessarily needed to escape this field. Default is false. * * @param forceQualifier Whether to force the fields to be qualified or not. */ public void setForceQualifier(boolean forceQualifier) { userSettings.ForceQualifier = forceQualifier; }
public void saveSettings() { settings.setProperty(UserSettings.DIRECTION, direction.toString()); settings.setProperty(UserSettings.LAYOUT, nodeLayout.toString()); settings.setProperty(UserSettings.ORDER, order.toString()); settings.save(); }
@Override public void cadastrar() { Aluno aluno = (Aluno) userSettings.getUsuario(); entidadeNegocio.setAluno(aluno); super.cadastrar(); }