Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 56339 Details for
Bug 167511
[Block]NPE when using customized IStyleProcessor with Chart Generator and no Chart will be rendered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
My SystemStyleProcessor.java
SystemStyleProcessor.java (text/java), 2.93 KB, created by
Bianca Jiang
on 2007-01-03 12:15:24 EST
(
hide
)
Description:
My SystemStyleProcessor.java
Filename:
MIME Type:
Creator:
Bianca Jiang
Created:
2007-01-03 12:15:24 EST
Size:
2.93 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2006 IBM Corporation and others. All rights reserved. This program and the > * accompanying materials are made available under the terms of the Eclipse > * Public License v1.0 which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * $Id: VerdictSummaryChart.java,v 1.6 2006/06/01 02:11:38 bjiang Exp $ > * > * Contributors: IBM - Initial API and implementation > ******************************************************************************/ >package org.eclipse.hyades.test.ui.forms.base; > >import org.eclipse.birt.chart.model.Chart; >import org.eclipse.birt.chart.model.ChartWithoutAxes; >import org.eclipse.birt.chart.model.attribute.ColorDefinition; >import org.eclipse.birt.chart.model.attribute.FontDefinition; >import org.eclipse.birt.chart.model.attribute.StyledComponent; >import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl; >import org.eclipse.birt.chart.model.attribute.impl.FontDefinitionImpl; >import org.eclipse.birt.chart.model.attribute.impl.TextAlignmentImpl; >import org.eclipse.birt.chart.style.IStyle; >import org.eclipse.birt.chart.style.IStyleProcessor; >import org.eclipse.birt.chart.style.SimpleStyle; >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Color; >import org.eclipse.swt.graphics.FontData; >import org.eclipse.swt.widgets.Display; > >public class SystemStyleProcessor implements IStyleProcessor { > > /** > * Recaculates the system settings for font, foreground color and background color and returns a new > * style with the current system settings. > */ > public IStyle getStyle(Chart model, StyledComponent name) { > > int component = name.getValue(); > if(model instanceof ChartWithoutAxes && > (//component == StyledComponent.CHART_BACKGROUND ))|| > component == StyledComponent.PLOT_BACKGROUND )) > { > FontData systemFontData = Display.getCurrent().getSystemFont().getFontData()[0]; > FontDefinition sFont = FontDefinitionImpl.create(systemFontData.getName(), > systemFontData.getHeight(), > (systemFontData.getStyle() & SWT.BOLD) > 0, > (systemFontData.getStyle() & SWT.ITALIC) > 0, > false, > false, > false, > 0, > TextAlignmentImpl.create( )); > > Color foregroundColor = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND); > ColorDefinition fgColor = ColorDefinitionImpl.create(foregroundColor.getRed(), foregroundColor.getGreen(), foregroundColor.getBlue()); > > Color backgroundColor = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND); > ColorDefinition bgColor = ColorDefinitionImpl.create(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue()); > > return new SimpleStyle(sFont, fgColor, bgColor, null, null); > } > > return null; > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 167511
: 56339