From: heeyoung Date: Tue, 21 Oct 2014 07:18:20 +0000 (+0900) Subject: Setting : remove screenshot source in feature tab X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=146b91e9151f9161ed9fd2f3631f36d508f5160e;p=sdk%2Ftools%2Fdynamic-analyzer.git Setting : remove screenshot source in feature tab Change-Id: I128752f97951becd2210bde9f1cba3ae80e9d765 Signed-off-by: heeyoung --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTable.java index 226506c..600449d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTable.java @@ -102,10 +102,6 @@ public class FeatureDialogFeaturesTable extends DATreeComposite { // check selected feature : , item_all_checked if (target.isSelectedFeature(featureName) == true) { optionColumn.append(FeatureDialog.ITEM_ALL_CHECKED); - } else if (ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION.equals(featureName)) { - if (target.isSelectedFeature(ConfigureLabels.FEATURE_NAME_SCREENSHOT)) { - optionColumn.append(FeatureDialog.ITEM_ALL_CHECKED); - } } else { optionColumn.append(CommonConstants.EMPTY); } @@ -137,12 +133,8 @@ public class FeatureDialogFeaturesTable extends DATreeComposite { TargetData target = SettingDataManager.getInstance().getTarget(null); Map map = target.getAvailableFeatureListMap(); - for (Map.Entry entry : map.entrySet()) { - + for (Map.Entry entry : map.entrySet()) { FeatureData feature = entry.getValue(); - if (feature.getFeatureName().equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY)) { - continue; - } // check exist current feature node if (existTreeInput(output, feature.getFeatureName()) == false) { @@ -196,9 +188,7 @@ public class FeatureDialogFeaturesTable extends DATreeComposite { } private String getDetailFeatureOptionText(String featureName) { - if (featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION)) { - return getScreenShotOptionText(featureName); - } else if (featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE) + if (featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE) || featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_PROFILING_SAMPLING_RATE)) { return getSystemOptionText(featureName); } else { @@ -224,30 +214,6 @@ public class FeatureDialogFeaturesTable extends DATreeComposite { return optionValue.toString(); } - private String getScreenShotOptionText(String featureName) { - StringBuffer optionValue = new StringBuffer(); - TargetData target = SettingDataManager.getInstance().getTarget(null); - boolean auto = target.isSelectedFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION); - boolean period = target.isSelectedFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY); - - if (auto) { // select : auto radio button - FeatureData periodFeature = target.getAvailableFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY); - optionValue.append(ConfigureLabels.AUTO + "1,"); - optionValue.append(ConfigureLabels.SAMPLING + periodFeature.getDefaultValue()); - } else if (auto == false) { // select : periodic radio button - if (period) { - optionValue.append(ConfigureLabels.AUTO + "0,"); - optionValue.append(ConfigureLabels.SAMPLING + target.getSelectedFeatureValue(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY)); - } else { - FeatureData autoFeature = target.getAvailableFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION); - FeatureData periodFeature = target.getAvailableFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY); - optionValue.append(ConfigureLabels.AUTO + autoFeature.getDefaultValue() + ","); - optionValue.append(ConfigureLabels.SAMPLING + periodFeature.getDefaultValue()); - } - } - return optionValue.toString(); - } - private Listener tableMouseListener = new Listener() { @Override public void handleEvent(Event event) { @@ -498,6 +464,5 @@ public class FeatureDialogFeaturesTable extends DATreeComposite { return true; } return false; - } - + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTreeTableToggleRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTreeTableToggleRenderer.java index 3add089..8a11d96 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTreeTableToggleRenderer.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialogFeaturesTreeTableToggleRenderer.java @@ -51,9 +51,6 @@ import org.tizen.dynamicanalyzer.nl.ConfigureLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton; -import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioGroup; -import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioSelectionListener; import org.tizen.dynamicanalyzer.widgets.da.base.DAText; public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRenderer { @@ -76,16 +73,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender private Label samplingInfo = null; private GridEditor samplingEditor = null; - // ScreenShot detail widget - private Composite detailScreenShotComposit = null; - private DARadioGroup radioGroup = null; - private DARadioButton auto = null; - private DARadioButton period = null; - private DAText screenShotTextBox = null; - private Label screenShotTextBoxLabel = null; - private Label screenShotInfo = null; - private GridEditor screenShotEditor = null; - public FeatureDialogFeaturesTreeTableToggleRenderer(Grid table) { super(); setSize(11, 9); @@ -94,7 +81,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender // init widget initSystemDetailWidget(); initSamplingDetailWidget(); - initSnapshotDetailWidget(); } // TODO:refactoring about the legacy code. @@ -191,8 +177,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender updateSystemDetails(item); } else if (ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_PROFILING_SAMPLING_RATE.equals(item.getText())) { updateSamplingDetails(item); - } else if (ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION.equals(item.getText())) { - updateScreenShotDetails(item); } // check is running @@ -315,81 +299,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender } - private void initSnapshotDetailWidget() { - detailScreenShotComposit = new Composite(table, SWT.NONE); - detailScreenShotComposit.setLayout(new FormLayout()); - detailScreenShotComposit.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD); - - radioGroup = new DARadioGroup(); - auto = new DARadioButton(detailScreenShotComposit, SWT.NONE); - FormData data = new FormData(); - data.top = new FormAttachment(0, 3); - data.left = new FormAttachment(0, 0); - data.width = 135; - data.height = 16; - auto.setLayoutData(data); - auto.setForeground(ColorResources.SETTING_COLOR); - auto.setBackground(ColorResources.DIALOG_BG_UPPER); - auto.setFont(FontResources.SETTING_DESCRIPTION_FONT); - auto.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION); - auto.addSelectionListener(autoScreenShotButtonListener); - radioGroup.addChild(auto); - auto.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD); - - period = new DARadioButton(detailScreenShotComposit, SWT.NONE); - data = new FormData(); - data.top = new FormAttachment(0, 3); - data.left = new FormAttachment(auto, 1); - data.width = 90; - data.height = 16; - period.setLayoutData(data); - period.setForeground(ColorResources.SETTING_COLOR); - period.setBackground(ColorResources.DIALOG_BG_UPPER); - period.setFont(FontResources.SETTING_DESCRIPTION_FONT); - period.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY); - period.addSelectionListener(periodScreenShotButtonListener); - radioGroup.addChild(period); - period.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD); - - // text box - screenShotTextBox = new DAText(detailScreenShotComposit, SWT.SINGLE); - data = new FormData(); - data.top = new FormAttachment(0, 4); - data.left = new FormAttachment(period, 5); - data.width = 50; - data.height = 13; - screenShotTextBox.setLayoutData(data); - - screenShotTextBox.setForeground(ColorResources.SETTING_COLOR); - screenShotTextBox.setFont(FontResources.SETTING_DESCRIPTION_FONT); - screenShotTextBox.getControl().addKeyListener(screenShotKeyListener); - - // label - screenShotTextBoxLabel = new Label(detailScreenShotComposit, SWT.TRANSPARENT); - screenShotTextBoxLabel.setText(ConfigureLabels.SECOND); - data = new FormData(); - data.top = new FormAttachment(0, 5); - data.left = new FormAttachment(screenShotTextBox.getControl(), 5); - data.width = 15; - data.height = 16; - screenShotTextBoxLabel.setLayoutData(data); - screenShotTextBoxLabel.setForeground(ColorResources.SETTING_COLOR); - screenShotTextBoxLabel.setFont(FontResources.SETTING_DESCRIPTION_FONT); - screenShotTextBoxLabel.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD); - - // waring label - screenShotInfo = new Label(detailScreenShotComposit, SWT.TRANSPARENT); - data = new FormData(); - data.top = new FormAttachment(0, 5); - data.left = new FormAttachment(screenShotTextBoxLabel, 5); - data.width = 250; - data.height = 16; - screenShotInfo.setLayoutData(data); - screenShotInfo.setForeground(ColorResources.RED); - screenShotInfo.setFont(FontResources.SETTING_DESCRIPTION_FONT); - screenShotInfo.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD); - } - private void updateSystemDetails(GridItem item) { // text box String text = getOptionText(item, ConfigureLabels.SAMPLING); @@ -440,47 +349,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender detailSamplingComposit.layout(true); } - private void updateScreenShotDetails(GridItem item) { - // radio group - boolean value = (getOptionText(item, ConfigureLabels.AUTO).equals("1")? true : false); - if (value == true) { - radioGroup.setSelection(auto); - } else { - radioGroup.setSelection(period); - } - - // text box - String text = getOptionText(item, ConfigureLabels.SAMPLING); - if (text.equals(screenShotTextBox.getText()) == false) { - screenShotTextBox.setText(text); - } - - // check radio button - if (period.isSelected() == true) { - screenShotTextBox.getControl().setEnabled(true); - checkValidInputText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY, - screenShotTextBox, screenShotInfo); - } else { - screenShotTextBox.getControl().setEnabled(false); - screenShotInfo.setText(CommonConstants.EMPTY); - } - - // check parent feature - if (isTableSelectedFeature(item.getParentItem().getText()) == true) { - detailScreenShotComposit.setEnabled(true); - } else { - detailScreenShotComposit.setEnabled(false); - screenShotTextBox.getControl().setEnabled(false); - screenShotInfo.setText(CommonConstants.EMPTY); - } - - screenShotEditor = new GridEditor(table); - screenShotEditor.horizontalAlignment = SWT.LEFT; - screenShotEditor.grabHorizontal = true; - screenShotEditor.setEditor(detailScreenShotComposit, item, 0); - detailScreenShotComposit.layout(true); - } - private void checkRunningState() { if (DACommunicator.isRunning()) { if (null != systemTextBox) { @@ -490,18 +358,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender if (null != samplingTextBox) { samplingTextBox.getControl().setEnabled(false); } - - if (null != auto) { - auto.setEnabled(false); - } - - if (null != period) { - period.setEnabled(false); - } - - if (null != screenShotTextBox) { - screenShotTextBox.getControl().setEnabled(false); - } } } @@ -593,32 +449,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender item.setText(1, optionText); } - private DARadioSelectionListener autoScreenShotButtonListener = new DARadioSelectionListener() { - - @Override - public void handleSelectionEvent(DARadioButton radio) { - if (auto.isSelected()) { - screenShotTextBox.getControl().setEnabled(false); - setOptionText(getGridItem(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION), - ConfigureLabels.AUTO, "1"); - } - SettingDialogManager.getInstance().updateFeatureButtonStatus(table); - } - }; - - private DARadioSelectionListener periodScreenShotButtonListener = new DARadioSelectionListener() { - - @Override - public void handleSelectionEvent(DARadioButton radio) { - if (period.isSelected()) { - screenShotTextBox.getControl().setEnabled(true); - setOptionText(getGridItem(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION), - ConfigureLabels.AUTO, "0"); - } - SettingDialogManager.getInstance().updateFeatureButtonStatus(table); - } - }; - private KeyListener systemKeyListener = new KeyListener() { @Override @@ -666,30 +496,6 @@ public class FeatureDialogFeaturesTreeTableToggleRenderer extends AbstractRender public void keyPressed(KeyEvent e) { } }; - - private KeyListener screenShotKeyListener = new KeyListener() { - - @Override - public void keyReleased(KeyEvent e) { - // check validation input text - boolean valid = checkValidInputText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY, - screenShotTextBox, screenShotInfo); - if (valid) { - screenShotInfo.setText(CommonConstants.EMPTY); - } - - // update button state - setOptionText(getGridItem(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION), - ConfigureLabels.SAMPLING, screenShotTextBox.getText()); - updateInputText(getGridItem(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION), valid); - - SettingDialogManager.getInstance().updateFeatureButtonStatus(table); - } - - @Override - public void keyPressed(KeyEvent e) { - } - }; /** * {@inheritDoc} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogManager.java index b918c54..7689ef0 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogManager.java @@ -165,18 +165,11 @@ public class SettingDialogManager { public boolean validInputText(Grid table) { for (int i = 0; i < table.getItemCount(); i++) { - String featureName = table.getItem(i).getText(0); String optionText = table.getItem(i).getText(1); if ((optionText.contains(FeatureDialog.ITEM_ALL_CHECKED)) - || (optionText.contains(FeatureDialog.ITEM_PART_CHECKED))) { - - if (featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION)) { - boolean value = (getOptionText(table.getItem(i), ConfigureLabels.AUTO).equals("1")? true : false); - if (value == false && optionText.contains(FeatureDialog.FEATURE_INVALID_VALUE)) { - return false; - } - } else if (optionText.contains(FeatureDialog.FEATURE_INVALID_VALUE)) { + || (optionText.contains(FeatureDialog.ITEM_PART_CHECKED))) { + if (optionText.contains(FeatureDialog.FEATURE_INVALID_VALUE)) { return false; } } @@ -195,18 +188,6 @@ public class SettingDialogManager { featureValue = new FeatureValueData(); featureValue.setFeatureName(featureName); featureValue.setValue(tableValue); - } else if (ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION.equals(featureName)) { - int tableAutoValue = Integer.parseInt(getOptionText(item, ConfigureLabels.AUTO)); - if (tableAutoValue == 1) { - featureValue = new FeatureValueData(); - featureValue.setFeatureName(featureName); - featureValue.setValue(1); - } else { - int tableValue = Integer.parseInt(getOptionText(item, ConfigureLabels.SAMPLING)); - featureValue = new FeatureValueData(); - featureValue.setFeatureName(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY); - featureValue.setValue(tableValue); - } } return featureValue; } @@ -221,24 +202,6 @@ public class SettingDialogManager { if (value != tableValue) { return true; } - } else if (ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION.equals(featureName)) { - int tableAutoValue = Integer.parseInt(getOptionText(item, ConfigureLabels.AUTO)); - if (tableAutoValue == 1) { - if (target.isSelectedFeature( - ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION) == false) { - return true; - } - } else { - if (target.isSelectedFeature(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY) == false) { - return true; - } else { - int value = target.getSelectedFeatureValue(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY); - int tableSamplingValue = Integer.parseInt(getOptionText(item, ConfigureLabels.SAMPLING)); - if (value != tableSamplingValue) { - return true; - } - } - } } return false; }